In This Chapter
Seeing your object’s lifelines
Sending messages to other objects
Capturing scenarios in sequence diagrams
Composing interactions from fragments
Whenever you need to understand how some objects interact, you should consider creating some type of UML interaction diagram. UML has a rich assortment of these diagrams to choose from, such as sequence diagrams, communication diagrams, activity diagrams, and timing diagrams, all of which are designed for the specific purpose of helping you express the details of how objects interact and collaborate to accomplish a behavior. And UML even allows you to mix these diagrams together. Don’t be bewildered. Following the guidelines given in Chapter 11 and the techniques of this chapter, you’ll come to rely upon sequence diagrams as your first choice in many circumstances.
Sequence diagrams, especially in their basic form, simply display the lifelines of participating objects as they exchange messages in a single scenario. (A lifeline represents the evolving life of the participating object by showing relevant events that are important to the object.) Of all available UML interaction diagrams, the sequence diagrams are usually the best suited to exploring the scenarios or flows of a particular use case. Not only are they easiest to draw, they are also easy for developers and clients alike to understand.
In this chapter, we introduce the features of sequence diagrams and help you depict interactions among your objects.