Professional Documents
Culture Documents
Detailed Design
Detailed Design
1 2
Course Number is a
foreign key, used to
implement the
“Belongs” relationship
Student ID is a
foreign key,
used to implement
the multi-valued
attribute
11 12
Object-oriented design 1 Requirements elicitation
• Object-oriented system is made up of interacting • Client and developers define the purpose of the
objects system:
- Maintain their own local state (private). - Develop use cases
- Provide operations over that state. - Determine functional and non-functional requirements
13 14
15 16
4 Object Design 5 Implementation
• Developers complete the object model by adding • Developers translate the class
implementation classes to the class diagram. diagram into source code.
17 18
19 20
Halstead Complexity Metric, cont. McCabe’s Cyclomatic Complexity
21 22
23 24
Good Design attributes Coupling
• Main goal: Simplicity • Coupling is the number of dependencies between
- Easy to understand two subsystems.
- Easy to change
- It measures the dependencies between two subsystems.
- Easy to reuse
- Easy to test • If two subsystems are loosely coupled, they are
- Easy to code relatively independent
• How do we measure simplicity of a design? - Modifications to one of the subsystems will have little
impact on the other.
- Coupling (goal: loose coupling)
- Cohesion (goal: strong cohesion) • If two subsystems are strongly coupled, modifications
to one subsystem is likely to have impact on the other.
ResourceManagement
IncidentManagement
ResourceManagement
IncidentManagement MapManagement
MapManagement Storage
subsystem. Criterion
assesses
Alternative
subsystem.
solvableBy
• If a subsystem contains many objects that are related to DesignProblem based-on
each other and perform similar tasks, its cohesion is high. resolvedBy
SubTask
•
* Decision
If a subsystem contains a number of unrelated objects, its
cohesion is low.
implementedBy
ActionItem Task
• Goal: decompose system so that it leads to subsystems subtasks
Alternative decomposition:
Decision tracking system Law of Demeter
RationaleSubsystem! • Good guideline for object-oriented design
Higher cohesion in each
subsystem. Criterion!
assesses!
Alternative!
• An object should send messages to only the following
But more subsystems and *! *!
- the object itself
*!
an extra interface between - the objects attributes (instance variables)
Task and Decision
DesignProblem! solvableBy! - the parameters of member functions of the object
based-on!
resolvedBy! - Any object created by this object
Decision! - Any object returned from a call to one of this objects member
PlanningSubsystem!
function
implementedBy!
SubTask! - Any object in any collection that is in one of the preceding
*! categories.