Monday, June 21, 2010

UML Sequence Diagrams - Activation blocks

Activation blocks tend to confuse people when learning UML Sequence Diagrams. I have to admit, if I haven't sequenced something for awhile, I forget how and especially why, too.


Activation blocks are usually only necessary once you start sequencing multiple calls within the same object or class.






If a sequence starts in an asp.net web page, such as Page_Load(...), and then a call is made to a method called InitializeVariables(), and then one to GetLogonUser(), as in Fig 1. Did Page_Load(...) call GetLogonUser(), or did InitializeVariables()?


We don't know unless we use activation blocks (See Fig 2 and Fig 3, showing each way).

Fig 2 shows that InitializeVariables() called GetLogonUser(),









Fig 3 shows that Page_Load(...) did.

No comments:

Post a Comment