- ~ Posted by Deepak Kamboj on October 8, 2009
A Sequence Diagram is an Object Diagram that describes object interaction. Objects are shown at the very top from left to right, while the time flows from top to bottom. Arrows indicate messages and other interactions between objects.
The official UML definition for Sequence Diagram is: A diagram that shows object interactions arranged in time sequence. In particular, it shows the objects participating in the interaction and the sequence of messages exchanged. Unlike a collaboration diagram, a sequence diagram includes time sequences but does not include object relationships. A sequence diagram can exist in a generic form (describes all possible scenarios) and in an instance form (describes one actual scenario). Sequence diagrams and Collaboration Diagrams express similar information, but show it in different ways.
We use sequence diagrams to realize use cases in the analysis model. Before we demonstrate the realization, we need to have a good understanding of sequence diagrams. Sequence diagrams are a type of interaction diagram. Collaboration diagrams are another type of interaction diagram. Although each of these types of interaction diagrams provides the same information, the focus of attention is different. Collaboration diagrams focus on the objects that work together to accomplish a given task or series of tasks. Sequence diagrams focus on the interaction of a given task or series of tasks as observed over time. In fact, some modeling tools automatically convert one diagram to the other.
- ~ Posted by Deepak Kamboj on October 8, 2009
A collaboration diagram, also called a communication diagram or interaction diagram, is an illustration of the relationships and interactions among software objects in the Unified Modeling Language (UML). The concept is more than a decade old although it has been refined as modeling paradigms have evolved. Collaboration diagrams, like Sequence Diagrams, show how objects interact over the course of time. However, instead of showing the sequence of events by the layout on the diagram, collaboration diagrams show the sequence by numbering the messages on the diagram. This makes it easier to show how the objects are linked together, but harder to see the sequence at a glance.
A collaboration diagram resembles a flowchart that portrays the roles, functionality and behavior of individual objects as well as the overall operation of the system in real time. Objects are shown as rectangles with naming labels inside. These labels are preceded by colons and may be underlined. The relationships between the objects are shown as lines connecting the rectangles. The messages between objects are shown as arrows connecting the relevant rectangles along with labels that define the message sequencing.
Collaboration diagrams are best suited to the portrayal of simple interactions among relatively small numbers of objects. As the number of objects and messages grows, a collaboration diagram can become difficult to read. Several vendors offer software for creating and editing collaboration diagrams.
A Collaboration Diagram is a diagram that shows object interactions organized around the objects and their links to each other. Unlike a Sequence Diagram, a Collaboration Diagram shows the relationships among the objects. Sequence diagrams and collaboration diagrams express similar information, but show it in different ways.
From the Visio Enterprise help: A collaboration diagram represents a collaboration, which is a set of object roles related in a particular context, and an interaction, which is the set of messages exchanged among the objects to achieve an operation or result. It is an interaction diagram that shows, for one system event defined by one Use Case, how a group of objects collaborate with one another. Unlike a Sequence Diagram, a collaboration diagram shows relationships among object roles and it does not express time as a separate dimension. Therefore, the messages in a collaboration diagram are numbered to indicate their sequence.