12.07.2015 Views

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

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Module 6 - Use-Case <strong>Analysis</strong>Maintaining Consistency: What to Look ForMaintaining Consistency: What to Look For• In order of criticality• Redundant responsibilities across classes• Disjoint responsibilities <strong>with</strong>in classes• Class <strong>with</strong> one responsibility• Class <strong>with</strong> no responsibilities• Better distribution of behavior• Class that interacts <strong>with</strong> many other classes<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 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 <strong>with</strong> similar responsibilities.When classes have similar responsibilities, combine them <strong>and</strong> 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 <strong>and</strong> redo it. It is better (<strong>and</strong> 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 <strong>with</strong> only one responsibility is not a problem, per se, but it should raisequestions on why it is needed. Be prepared to challenge <strong>and</strong> justify the existence ofall classes.6 - 39

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

Saved successfully!

Ooh no, something went wrong!