29.11.2014 Views

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

18. UML: Dynamic Modeling And Deployment<br />

18.1 <strong>Introduction</strong><br />

The basic class <strong><strong>an</strong>d</strong> association notations of the object model in the Unified Modeling L<strong>an</strong>guage (or<br />

UML for short) were presented in the last chapter. This chapter presents the sequence, collaboration<br />

diagrams <strong><strong>an</strong>d</strong> state diagrams as part of the dynamic modeling facilities in the UML. We then consider<br />

deployment diagrams.<br />

18.2 Dynamic modeling facilities<br />

18.2.1 Sequence diagrams<br />

A scenario shows a particular series of interactions among objects in a s ingle execution of a system.<br />

That is, it is a history of how the system behaved from one start state to a single termination state. This<br />

differs from <strong>an</strong> envisionment which is a description of all system behaviors from all start states to all<br />

end states. En visionments thus contain all possible histories (although they may also contain paths<br />

which the system is never intended to take).<br />

Scenarios c<strong>an</strong> be presented in two different ways: Sequence Diagrams <strong><strong>an</strong>d</strong> Collaboration Diagrams.<br />

Both these diagrams present t he same information although they stress different aspects of this<br />

information. For example, sequence diagrams stress the timing aspects of the interactions amongst the<br />

objects, where as the collaboration diagrams stress the structure between these objects (which helps in<br />

underst<strong><strong>an</strong>d</strong>ing the requirements of the underlying software structure).<br />

Figure 18.1 illustrates the basic structure of a sequence diagram. The objects involved in the<br />

exch<strong>an</strong>ge of messages are represented as vertical lines (which are labeled with the object’s name). For<br />

example, Caller, Phone Line <strong><strong>an</strong>d</strong> Callee are all objects involved in the scenario of dialing 999 (the<br />

Emergency services’ number in the UK). Time proceeds vertically down the diagram, as indic ated by<br />

the dashed line arrow. The horizontal arrows indicate <strong>an</strong> event or message sent from one object to<br />

<strong>an</strong>other. The arrow indicates the direction in which the event or message is sent. That is, the receiver is<br />

indicated by the head of the arrow. Normall y return values are not shown on these diagrams. However,<br />

if they are signific<strong>an</strong>t, they c<strong>an</strong> be illustrated by return events <strong>an</strong>notated with the type of value returned<br />

etc.<br />

Time proceeds vertically <strong><strong>an</strong>d</strong> c<strong>an</strong> be made more explicit by additional timing marks. T hese timing<br />

marks indicate how long the gap between messages should be or how long a message or event should<br />

take to get from the sender to the receiver.<br />

147

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

Saved successfully!

Ooh no, something went wrong!