2.4X Alternative

We should perhaps discuss if we can use the same style for showing snapshots whether they are object diagrams or OSDs.
Here is an attempt.
The texts below are just sketches that must be rewritten/reformulated if we decide to go this way.

One important decision is if we shall introduce aClerk executing statements. This is simple and it is said that objects may have actions. The disadvantage is that it may complicate the presentation of this section.
Alternatively we may introduce a method handle as in usingAccount.

We may introduce an object containing the assignments and method invocation as shown below. See the comment in 2.4.

aClerk: obj
   account_1010.balance := 350.5
   account_1010.interestRate := 0.7
   account_1010.addInterest

We may then present a number of snapshots

The first snapshot shows the situation after account_1010 has been generated. Owner = “John Smith”, and the initial values of balance and interestRate is 0 (zero).

    aClerk: obj
  -->  account_1010.balance := 350.5
       account_1010.interestRate := 0.7
       account_1010.addInterest
      ...

The next snapshot shows the situation after execution of the first assignment

    aClerk: obj
       account_1010.balance := 350.5
  -->  account_1010.interestRate := 0.7
       account_1010.addInterest
       ...

The next snapshot shows the situation after execution of the second assignment

    aClerk: obj
       account_1010.balance := 350.5
       account_1010.interestRate := 0.7
  -->  account_1010.addInterest
       ...

The final snapshot shows the situation after the method invocation.

    aClerk: obj
       account_1010.balance := 350.5
       account_1010.interestRate := 0.7
       account_1010.addInterest
  -->  ...

© Copyright by Ole Lehrmann Madsen and Birger Møller-Pedersen 2023.