

Vertical rectangles placed along a life line that are called activations.

Each object’s and actor’s life line is used to organize things that happen related to the object or actor with the earliest at the top and the latest at the bottom.

Because the names in Figure 2 are preceded by a colon ( :), you know that the names are the names of the class that each object is an instance of.īelow each actor and object is a dashed vertical line called a life line. You know that they are objects rather than classes because the names in the boxes are underlined. Stick figures represent an external actor. Figure 2 is the sequence diagram you saw previously, but with some annotations added. Sequence Diagram Elementsīefore moving on to the next topic, look at UML terminology for some of the elements of a sequence diagram. Next, it calls the TollGate object’s raiseTollGate operation. It calls the TollBasket object’s collectToll operation. The collectNextToll operation makes a synchronous call to two other operations. You know that the calls are synchronous because of the solid closed arrowhead ( ). This means that the start operation must wait for the collectNextToll operation to finish before continuing. The start operation’s calls to the collectNextToll operation are synchronous. You know that the calls to the collectNextToll operation are repeated indefinitely because of the asterisk ( *) that precedes the name of the operation. The start operation repeatedly calls the TollBooth object’s collectNextToll operation. This means that after initiating the start operation, the TollManager does not wait for the operation to finish it just continues to go about its business at the same time. You know that it runs asynchronously of what the TollManager is doing because of the open arrowhead ( ). The start operation runs asynchronously of what the TollManager is doing. A TollManager, who is some kind of external actor, causes a TollBooth object’s start operation to be called. This diagram shows some of the interactions among the objects involved in running a toll gate in a toll plaza. Figure 1 shows an example of a sequence diagram. UML sequence diagrams show a sequence of interactions among objects. If the interaction involves a method or relationship that does not yet exist in the object mode, you either add it to the model or modify something already in the object model to accommodate the interaction. The most common type of interaction diagram used for this purpose is a sequence diagram. The usual way to refine this estimate into a detailed object model is to work through the object interactions that are needed to support individual features or use cases.Īs you discover each interaction, you add it to an interaction diagram. The process of object-oriented design begins with an initial estimate of the classes that will be needed. This allows the relationships and responsibilities of classes to be worked out efficiently and with little distraction. The value of Object-Oriented Design is in allowing major structural decisions to be made before being committed to code.
