This is the first part of our OO analysis series posts. What we are going to talk about here is how to construct use case diagram
, use case description
and class diagram
. First, we construct the use case diagram from user requirements. This will give us an overview to the system that we are going to build. Base on the use case diagram and user requirements, we then finish the use case description. This will show us more details about each use cases. This phase also helps to identify the potential classes and attributes of each class in the next phase. Finally we make the class diagram, this is the blue print of the system that we are gonna develop. (Note: This article reference from professor T.H Tse’s lecture notes , The university of Hong Kong)
- Construct Use Case Diagram
- Construct Use Case Description
- Construct Class Diagram
Constructing Use Case Diagram
Steps of Constructing Use Case Diagram
The following are the recommended procedure for constructing use case diagram:
- Identify actors and use cases.
- Identify use case relationships.
- Construct use case diagram.
Structure of Use Case Diagram
This figure shows the structure and elements of a use case diagram:
Constructing Use Case Discription (For each use case)
Steps of Constructing Use Case Discription
The following are the recommended procedure for constructing use case description:
- Document use case name, actors, descriptions .etc.
- Document preconditions, postconditions, assumptions.
- Document normal course.
- Document alternative course.
- Add-in include use cases.
- Add-in extend use cases.
- Add-in exceptions.
- Finish.
Use Case Description Template
This figure shows the template of use case description:
Constructing Class Diagram
Structure of Class Diagram
This figure shows the structure and elements of a class diagram:
Steps of Constructing Class Diagram
The following are the recommended procedure for constructing class diagram:
- Identify classes.
- Keeping the right classes.
- Identify class relationships.
- Keeping the right class relationships.
- Identify attributes and methods.
- Keiiping the right attriutes and methods.
- Constructing class Diagram.
Indentify Classes
- Usually be nouns.
- Must Meaningful in application domain.
- Must be persistance.
Keeping the Right Classes
- Eliminate redundant classes.
- Eliminate irrelevant classes.
- Eliminate vague classes.
- Eliminate attributes.
- Eliminate operations(methods).
- Eliminate role(relationship).
- Eliminate implementation constructs.
Identify Relationships
Identify Association
Maybe related to:
- Ownership
- Has-a
- Has-many
- Uses-a
- Uses-many
- Directed actions
- Physical location
- Communication
Identify Aggeregation
- Indicated by Is-part-of relationship
- Has-a
- Has-many
Identify Inheritance
- Indicated by Is-a relationship
- Generalization(Bottom-up)
- Specialization(Top-down)
Keeping the Right Association
- Eliminate implementation construct associations.
- Eliminate actions.
- Eliminate missnamed associations.
- Add-in role names.
- Add-in multiplicity.
- Add-in missing associations.
Identify Attributes
- Usually be nouns.
- Indicated by possessive phrases.
- Indicated by adjectives.
Keeping the Right Attributes
- Eliminate discordant attributes.
- Eliminate classes.
- Eliminate internal values.
- Indentifiers may or may not be attributes.
Further Discussion
There is still one thing we haven’t discussed yet. That’s how to identify methods(operations) of class diagram. Before doing so, we need the help of other dynamic models like sequence diagram and state diagram. And these topics will be covered in OO analysis with UML 2 on kelvin.ink.
近期评论