![]() ![]() There are no hard and fast rules about whether to use a sequence or a collaboration diagram in any particular situation. ![]() This is valuable when you are preparing a state diagram (see Chapter 7), since the state diagram needs to know everything that can happen to a class of objects. Collaboration diagrams are also useful when you want to view the complete set of messages from the point of view of one object. Sequence diagrams do not explicitly show links, although an underlying link can be assumed or the message could not be sent. In a collaboration diagram this association between classes is represented by an explicit link between the objects of the classes (for example, the link between :Customer and :Payment in Figure 6.14). A message from one object to another means that there should be an association between the classes to which they belong. The special feature of collaboration diagrams is that they include explicit links between objects. Collaboration diagrams don't have the equivalent of activations. ![]() Another feature that can be added to a sequence diagram is object activation, showing when the object is active. ![]() Sequence diagrams can also include return arrows collaboration diagrams never show return arrows. It is, of course, possible to figure out the sequence of messages from the numbers on a collaboration diagram, but it is not so intuitively clear. The order of messages is very clear: a sequence diagram reads from top to bottom. The main advantage of the sequence diagram is its ability to represent the passage of time graphically. Both diagrams can be used to represent the functionality of the system at different levels, for example to illustrate how a use case is realized or to show the workings of a complicated operation. If either diagram gets too cluttered with messages we can choose to model only the main flow of messages. Both types of diagram convert a textual scenario into a graphical view of the flow of events, and both can be shown at varying levels of detail. Carol Britton, Jill Doake, in A Student Guide to Object-Oriented Development, 2005 Using sequence and collaboration diagramsĪs sequence and collaboration diagrams are logically equivalent (they display the same information), there is no point in drawing both at any given stage. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |