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 UMLExample: View of Participating Classes (VOPC) Class DiagramExample: View of Participating Classes (VOPC) Class DiagramStudent// get tuition()// add schedule()// get schedule()// delete schedule()// has pre-requisites()RegistrationController// get course offerings()// get current schedule()// delete current schedule()// submit schedule()// is registration open?()// save schedule()// create schedule with offerings()// update schedule with new selections()Schedule// commit()// select alternate()// remove offering()// level()// cancel()// get cost()// delete()// submit()// save()// any conflicts?()// create with offerings()// update with new selections()RegisterForCoursesFormCourseCatalogSystem// get course offerings()// display course offerings()// display blank schedule()// update offering selections()Mastering Object Oriented Analysis and Design with UMLCopyright © 2003 Rational Software, all rights reserved 38The View of Participating Classes (VOPC) class diagram contains the classes whoseinstances participate in the Use-Case Realization Interaction diagrams, as well as therelationships required to support the interactions. We will discuss the relationshipslater in this module. Right now, we are most interested in what classes have beenidentified, and what responsibilities have been allocated to those classes.6 - 38
Module 6 - Use-Case AnalysisMaintaining Consistency: What to Look ForMaintaining Consistency: What to Look For• In order of criticality• Redundant responsibilities across classes• Disjoint responsibilities within classes• Class with one responsibility• Class with no responsibilities• Better distribution of behavior• Class that interacts with many other classesMastering Object Oriented Analysis and Design with UMLCopyright © 2003 Rational Software, all rights reserved 39Examine classes to ensure they have consistent responsibilities. When a class’sresponsibilities are disjoint, split the object into two or more classes. Update theInteraction diagrams accordingly.Examine classes to ensure that there are not two classes with similar responsibilities.When classes have similar responsibilities, combine them and update the Interactiondiagrams accordingly.Sometimes a better distribution of behavior becomes evident while you are workingon another Interaction diagram. In this case, go back to the previous Interactiondiagram and redo it. It is better (and easier) to change things now than later in design.Take the time to set the diagrams right, but do not get hungup trying to optimize theclass interactions.A class with only one responsibility is not a problem, per se, but it should raisequestions on why it is needed. Be prepared to challenge and justify the existence ofall classes.6 - 39
- 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 240 and 241: DEV475 Mastering Object-Oriented An
- Page 242 and 243: DEV475 Mastering Object-Oriented An
- Page 244 and 245: 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>Example: View of Participating Classes (VOPC) Class DiagramExample: View of Participating Classes (VOPC) Class DiagramStudent// get tuition()// add schedule()// get schedule()// delete schedule()// has pre-requisites()RegistrationController// get course offerings()// get current schedule()// delete current schedule()// submit schedule()// is registration open?()// save schedule()// create schedule <strong>with</strong> offerings()// update schedule <strong>with</strong> new selections()Schedule// commit()// select alternate()// remove offering()// level()// cancel()// get cost()// delete()// submit()// save()// any conflicts?()// create <strong>with</strong> offerings()// update <strong>with</strong> new selections()RegisterForCoursesFormCourseCatalogSystem// get course offerings()// display course offerings()// display blank schedule()// update offering selections()<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 38The View of Participating Classes (VOPC) class diagram contains the classes whoseinstances participate in the Use-Case Realization Interaction diagrams, as well as therelationships required to support the interactions. We will discuss the relationshipslater in this module. Right now, we are most interested in what classes have beenidentified, <strong>and</strong> what responsibilities have been allocated to those classes.6 - 38