DEV475 Mastering Object-Oriented Analysis and Design with UML ...

DEV475 Mastering Object-Oriented Analysis and Design with UML ... DEV475 Mastering Object-Oriented Analysis and Design with UML ...

crnarupa.singidunum.ac.rs
from crnarupa.singidunum.ac.rs More from this publisher
12.07.2015 Views

DEV475 Mastering Object-Oriented Analysis and Design with UMLThe Anatomy of Collaboration DiagramsThe Anatomy of Collaboration DiagramsClient ObjectLinkSupplier Object:ClientPerformResponsibility:SupplierMessageMastering Object Oriented Analysis and Design with UMLCopyright © 2003 Rational Software, all rights reserved 32A Collaboration diagram describes a pattern of interaction among objects. It showsthe objects participating in the interaction by their links to each other and themessages that they send to each other.An object is represented in one of three ways:• Objectname:Classname• ObjectName• :ClassNameA link is a relationship between objects that can be used to send messages. InCollaboration diagrams, a link is shown as a solid line between two objects. An objectinteracts with, or navigates to, other objects through its links to these objects. A link isdefined as an instance of an association.A message is a communication between objects that conveys information with theexpectation that activity will result. In Collaboration diagrams, a message is shown asa labeled arrow placed near a link. This means that the link is used to transport orotherwise implement the delivery of the message to the target object. The arrowpoints along the link in the direction of the target object (the one that receives themessage). The arrow is labeled with the name of the message and its parameters. Thearrow may also be labeled with a sequence number to show the sequence of themessage in the overall interaction. Sequence numbers are often used in Collaborationdiagrams because they are the only way of describing the relative sequencing ofmessages. A message can be unassigned, meaning that its name is a temporary stringthat describes the overall meaning of the message. You can later assign the messageby specifying the operation of the message's destination object. The specifiedoperation will then replace the name of the message.6 - 32

Module 6 - Use-Case AnalysisExample: Collaboration DiagramExample: Collaboration Diagram5: // display course offerings( )6: // display blank schedule( ): Course Catalog: RegisterForCoursesForm4: // get course offerings( ): CourseCatalogSystem2: // get course offerings( )8: // create schedule with offerings( )1: // create schedule( )7: // select 4 primary and 2 alternate offerings( )3: // get course offerings(forSemester): RegistrationController: Student: Schedule9: // create with offerings( )10: // add schedule(Schedule): StudentMastering Object Oriented Analysis and Design with UMLCopyright © 2003 Rational Software, all rights reserved 33The above example shows the collaboration of objects to support the Register forCourses use case, Create a Schedule subflow. It is the “Collaboration diagramequivalent” of the Sequence diagram shown earlier.6 - 33

<strong>DEV475</strong> <strong>Mastering</strong> <strong>Object</strong>-<strong>Oriented</strong> <strong>Analysis</strong> <strong>and</strong> <strong>Design</strong> <strong>with</strong> <strong>UML</strong>The Anatomy of Collaboration DiagramsThe Anatomy of Collaboration DiagramsClient <strong>Object</strong>LinkSupplier <strong>Object</strong>:ClientPerformResponsibility:SupplierMessage<strong>Mastering</strong> <strong>Object</strong> <strong>Oriented</strong> <strong>Analysis</strong> <strong>and</strong> <strong>Design</strong> <strong>with</strong> <strong>UML</strong>Copyright © 2003 Rational Software, all rights reserved 32A Collaboration diagram describes a pattern of interaction among objects. It showsthe objects participating in the interaction by their links to each other <strong>and</strong> themessages that they send to each other.An object is represented in one of three ways:• <strong>Object</strong>name:Classname• <strong>Object</strong>Name• :ClassNameA link is a relationship between objects that can be used to send messages. InCollaboration diagrams, a link is shown as a solid line between two objects. An objectinteracts <strong>with</strong>, or navigates to, other objects through its links to these objects. A link isdefined as an instance of an association.A message is a communication between objects that conveys information <strong>with</strong> theexpectation that activity will result. In Collaboration diagrams, a message is shown asa labeled arrow placed near a link. This means that the link is used to transport orotherwise implement the delivery of the message to the target object. The arrowpoints along the link in the direction of the target object (the one that receives themessage). The arrow is labeled <strong>with</strong> the name of the message <strong>and</strong> its parameters. Thearrow may also be labeled <strong>with</strong> a sequence number to show the sequence of themessage in the overall interaction. Sequence numbers are often used in Collaborationdiagrams because they are the only way of describing the relative sequencing ofmessages. A message can be unassigned, meaning that its name is a temporary stringthat describes the overall meaning of the message. You can later assign the messageby specifying the operation of the message's destination object. The specifiedoperation will then replace the name of the message.6 - 32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!