A property write invokes its setter and a read invokes its getter. A sequence diagram can make that execution visible even though the caller uses assignment syntax.
Assume an existing Player whose JerseyNumber property stores any assigned integer and returns that stored value. The backing field initially contains 1. The complete implementation appears in the accessor lesson.
selected.JerseyNumber = 7;
int displayedNumber = selected.JerseyNumber;The setter first stores 7. Once it completes, the getter returns 7 and the controller assigns that result to displayedNumber. No object is created by either statement.
controller : Controller and selected : Player lifelines in Violet.set JerseyNumber(7) to selected and show its activation finishing.get JerseyNumber() to the same receiver. Show the returned value 7.Store result in displayedNumber.Setter completion returns control, not an integer result. The getter result is the value stored by the caller.