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 ...
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
- Page 190 and 191: DEV475 Mastering Object-Oriented An
- Page 192 and 193: DEV475 Mastering Object-Oriented An
- Page 194 and 195: DEV475 Mastering Object-Oriented An
- Page 196 and 197: DEV475 Mastering Object-Oriented An
- Page 198 and 199: DEV475 Mastering Object-Oriented An
- Page 200 and 201: DEV475 Mastering Object-Oriented An
- Page 202 and 203: DEV475 Mastering Object-Oriented An
- Page 204 and 205: DEV475 Mastering Object-Oriented An
- Page 206 and 207: DEV475 Mastering Object-Oriented An
- Page 208 and 209: DEV475 Mastering Object-Oriented An
- Page 210 and 211: DEV475 Mastering Object-Oriented An
- Page 212 and 213: DEV475 Mastering Object-Oriented An
- Page 214 and 215: DEV475 Mastering Object-Oriented An
- Page 216 and 217: DEV475 Mastering Object-Oriented An
- Page 218 and 219: DEV475 Mastering Object-Oriented An
- Page 220 and 221: DEV475 Mastering Object-Oriented An
- Page 222 and 223: DEV475 Mastering Object-Oriented An
- Page 224 and 225: DEV475 Mastering Object-Oriented An
- Page 226 and 227: DEV475 Mastering Object-Oriented An
- Page 228 and 229: DEV475 Mastering Object-Oriented An
- Page 230 and 231: DEV475 Mastering Object-Oriented An
- Page 232 and 233: DEV475 Mastering Object-Oriented An
- Page 234 and 235: DEV475 Mastering Object-Oriented An
- Page 236 and 237: DEV475 Mastering Object-Oriented An
- Page 238 and 239: DEV475 Mastering Object-Oriented An
- Page 242 and 243: DEV475 Mastering Object-Oriented An
- Page 244 and 245: DEV475 Mastering Object-Oriented An
- Page 246 and 247: DEV475 Mastering Object-Oriented An
- Page 248 and 249: DEV475 Mastering Object-Oriented An
- Page 250 and 251: DEV475 Mastering Object-Oriented An
- Page 252 and 253: DEV475 Mastering Object-Oriented An
- Page 254 and 255: DEV475 Mastering Object-Oriented An
- Page 256 and 257: DEV475 Mastering Object-Oriented An
- Page 258 and 259: DEV475 Mastering Object-Oriented An
- Page 260 and 261: DEV475 Mastering Object-Oriented An
- Page 262 and 263: DEV475 Mastering Object-Oriented An
- Page 264 and 265: DEV475 Mastering Object-Oriented An
- Page 266 and 267: DEV475 Mastering Object-Oriented An
- Page 268 and 269: DEV475 Mastering Object-Oriented An
- Page 270 and 271: DEV475 Mastering Object-Oriented An
- Page 272 and 273: DEV475 Mastering Object-Oriented An
- Page 274 and 275: DEV475 Mastering Object-Oriented An
- Page 276: DEV475 Mastering Object-Oriented An
<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