In turn, the Fine object is a Supplier to the Transaction Client object. In Figure 2, the Transaction object acts as a Supplier to the UI (User Interface) Client object. Collaboration diagrams are so closely related to sequence diagrams that some modeling tools can automatically generate one type of diagram from the other. Client objects call methods on supplier objects, and therefore send messages. Supplier objects are the objects that supply the method that is being called, and therefore receive the message. Objects participating in a collaboration come in two flavors?supplier and client. There are three primary elements of a collaboration diagram: However, before fully understanding this difference, you need to learn about the basic elements of a collaboration diagram. Figure 2: A collaboration diagram is best suited for showing the relationships between objects involved in a collaboration. It also becomes clear that it's much easier to determine the time ordering of messages by looking at the sequence diagram and it's easier to see the relationships between objects by looking at the collaboration diagram. If you compare the two diagrams, you'll see they both contain objects and messages. If you open this sequence diagram in Rational® Rose and then press the F5 key, Rose automatically generates the collaboration diagram shown in Figure 2. Figure 1: A sequence diagram is ideal for showing the time-ordering of messages during an object interaction. This particular sequence, shown in Figure 1, documents the interaction that occurs between business objects when determining how many items a borrower can check out of the library. This sequence diagram is one of the design documents created for a research and development library. To demonstrate this close relationship, this article will take a sequence diagram from the previous article in this series and show how it translates into a collaboration diagram. In fact, collaboration diagrams are so closely related to sequence diagrams, that some modeling tools, such as Rational Rose, can automatically create one type of diagram from the other. In reality, sequence diagrams and collaboration diagrams show the same information, but just present it differently. From Sequence Diagram to Collaboration Diagram Once you put your classes into action (or interaction), you can often see flaws in your static model that may not have been discovered otherwise. Some developers take the step of creating static models of their business objects, but don't "prove" their models by creating associated dynamic models. In addition, collaboration diagrams can also help you determine the accuracy of your static model (i.e., class diagrams). This is difficult to determine from a sequence diagram. So, why would you use collaboration diagrams?įirst of all, they are very useful for visualizing the relationship between objects collaborating to perform a particular task. Of the two types of interaction diagrams, sequence diagrams seem to be used far more than collaboration diagrams. In contrast, collaboration diagrams focus on the relationships between the collaborating objects. Collectively, both of these are known as interaction diagrams.Īlthough they both describe object interaction, sequence diagrams focus on showing the order in which messages are sent between objects. There are two diagrams in the Unified Modeling Language (UML) that help to document and describe this interaction?sequence diagrams and collaboration diagrams. Often, business objects need to call on the services of other business objects to accomplish a particular task. Collaboration diagrams allow you to see both the dynamic aspects and static relationships of business objects in a single diagram. As the user interacts with the software, business objects respond by carrying out requested actions such as performing calculations, retrieving, validating and manipulating data. UML collaboration diagrams are great tools for documenting the flow of messages between objects while providing a unique perspective?a view of the relationships between collaborating objects.Īt the very heart of any complex software application are business objects. In well-designed software systems, powerful business objects work together to accomplish a variety of tasks.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |