13.07.2015 Views

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

94 Collaboration Diagrams2. The order and nesting of subsequent messages is shown <strong>with</strong> a legal numbering scheme in whichnested messages have appended to them a number. Nesting is denoted by prepending the incomingmessage number to the outgoing message number.msg1():A1:msg2():B1.1:msg3()2.1:msg5()2:msg4():C2.2:msg6():DFigure 7.9: Sequence numberingRepresenting conditional messages Sometimes, a message may be guarded and can be sent from oneobject to another only when a condition holds. This is illustrated in Figure 7.10.msg1():POST1:[new sale] create():Sale1.1:create():SalesLineItemFigure 7.10: Conditional messageAt a point during the execution of an object, a choice of several messages, guarded by different conditions,will be sent. In a sequential system, an object can send one message at a time and thus these conditionsmust be mutually exclusive. When we have mutually exclusive conditional messages, it is necessary tomodify the sequence expressions <strong>with</strong> a conditional path letter. This is illustrated in Figure 7.11. Note thatEither or l could execute after , depending on the conditions.=The sequence number for both is 1, and and R|¥R represent the two paths.¤£ YvA¦h-|§ | l =Report No. 259, July 2002<strong>UNU</strong>/<strong>IIST</strong>, P.O. Box 3058, Macau=This can be generalised to any number of mutually exclusive Conditional Messages.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!