FIT2001 Lecture Notes - Lecture 9: Class Diagram, Loose Coupling, Use Case
L9 - Use case realisation: Design class diagrams and Sequence
Diagrams
OO Design
The bridge between users requirements and programming for the new system.
Fundamental Design Principles
●Encapsulation - each object is self-contained unit that includes both data and program
logic
●Object Reuse - standard objects can be used over and over again within a system
●Information Hiding - data associated with an object is not visible. Methods provide
access to data
●Separation of Responsibilities - objects are responsible for system processing
●Protection from Variation - parts that are unlikely to change should be segregated
●Indirection - separating two classes or system components by placing an intermediate
class to serve as a link
●Coupling - qualitative measure of how closely classes linked. Low coupling makes a
system easier to understand maintain; minimum ripple effect.
●Cohesion - ensure clear separation of responsibility. High cohesion often leads to low
cohesion
Iterative OO Design Process
1. Create a first-cut Design Class Diagram
2. Create Sequence Diagrams for each use case
3. Return to Design Class Diagram and update based on the design of Sequence Diagrams
4. Partition Design Classes into related functions (subsystems) using package diagrams
Design Class Diagrams
The first-cut Design Class Diagram is used to help develop the Sequence Diagram which will then
be used to refine the Design Class Diagram
How to Make One
●Create a first-cut Design class diagram
○Elaborate the attributes
■Add additional attributes if required
■Define their type
■Declare visibility (most are private)
○Show navigation visibility (add visibility arrows)
■The ability of one object to view and interact with another object
■Can be directional
■Will need to updated as design progresses
Template:
<<Entity>>
Class Name :: Parent Class
Attribute list
Visibility name: type-expression = initial-value { property
Method List
Visibility name: type-expression (parameter list)
Example:
<<Entity>>
Student
- studentID : integer {key}
- Name: string
- Address: string
- dateAdmitted: date
+ createStudent(name, address, major):Student
+ createStudent(studentID):Student
+changeName(name)
+changeAddress(address)
The Domain Class Diagram transforms into the Design Class Diagram
Document Summary
L9 - use case realisation: design class diagrams and sequence. The bridge between users requirements and programming for the new system. Encapsulation - each object is self-contained unit that includes both data and program logic. Object reuse - standard objects can be used over and over again within a system. Information hiding - data associated with an object is not visible. Separation of responsibilities - objects are responsible for system processing. Protection from (ariation - parts that are unlikely to change should be segregated. Indirection - separating two classes or system components by placing an intermediate class to serve as a link. Coupling - qualitative measure of how closely classes linked. Low coupling makes a system easier to understand maintain; minimum ripple effect. Cohesion - ensure clear separation of responsibility. The first-cut design class diagram is used to help develop the sequence diagram which will then be used to refine the design class diagram.