Lecture 6 - Chapter 12
Lecture 6 - Chapter 12
Object-oriented design
The process to identify the classes, their methods
and the messages required for a use case
Three paths
Simple use case
use CRC Cards
Medium use case
use Communication
Diagram
Complex use case
use Sequence
Diagram
Three paths
Simple use case
use CRC Cards
Medium use case
use Communication
Diagram
Complex use case
use Sequence
Diagram
Now ask what this first class needs to carry out the responsibility. Assign
other classes responsibilities to satisfy each need. Write responsibilities on
those cards.
Sometimes different designers play the role of each class, acting out the
use case by verbally sending messages to each other demonstrating
responsibilities
45
Systems Analysis and Design in a Changing World, 7th edition – Chapter 5 ©2016.
Cengage Learning. All rights reserved.
Example: Create customer Account
First-cut DCD
BankAccount BankLoan
+Open() +Grant()
+Close() +Decrease()
+GetBalance():double +GetInstallment():double
+Activate() +Activate()
+GetLoanBalance():doub
+Reactivate()
le
+GetLoanBalance():doub
HighleCohesion?!
High Cohesion?!
High Cohesion?!
Fundamental Design Principles
Protection from Variations
A design principle that states parts of a system
unlikely to change are separated (protected) from
those that will surely change
Separate user interface forms and pages that are
likely to change from application logic
Put database connection and SQL logic that is likely to
change in separate classes from application logic
Use adaptor classes that are likely to change when
interfacing with other systems
If deciding between two alternative designs, choose
the one where there is protection from variations