object oriented analysis with uml 1 Constructing Use Case Diagram Constructing Use Case Discription (For each use case) Constructing Class Diagram Further Discussion

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)

  1. Construct Use Case Diagram
  2. Construct Use Case Description
  3. Construct Class Diagram

Constructing Use Case Diagram

Steps of Constructing Use Case Diagram

The following are the recommended procedure for constructing use case diagram:

  1. Identify actors and use cases.
  2. Identify use case relationships.
  3. Construct use case diagram.

Structure of Use Case Diagram

This figure shows the structure and elements of a use case diagram:
Use Case Diagram Structure

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:

  1. Document use case name, actors, descriptions .etc.
  2. Document preconditions, postconditions, assumptions.
  3. Document normal course.
  4. Document alternative course.
  5. Add-in include use cases.
  6. Add-in extend use cases.
  7. Add-in exceptions.
  8. Finish.

Use Case Description Template

This figure shows the template of use case description:
Use Case Description Template

Constructing Class Diagram

Structure of Class Diagram

This figure shows the structure and elements of a class diagram:
Class Diagram Structure

Steps of Constructing Class Diagram

The following are the recommended procedure for constructing class diagram:

  1. Identify classes.
  2. Keeping the right classes.
  3. Identify class relationships.
  4. Keeping the right class relationships.
  5. Identify attributes and methods.
  6. Keiiping the right attriutes and methods.
  7. 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.