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 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

<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

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

Saved successfully!

Ooh no, something went wrong!