Class Diagram Example: Association Class and Self Association

Description:

This is a class diagram example that shows the use of association class in a class model. In between the Company and Person class, a Job class can be created as an association class.

Use this Class diagram template to get started building your own. Customize the Class diagram to reflect your object model. Click Use this Template to start.

What is Class Diagram?

Class diagrams provide a structural view of systems which capture the static structure of Object-Oriented systems, or how they are structured rather than how they behave. A class diagram supports architectural design and typically represent the basics of a Object Oriented system. It identifies what classes there are, how they interrelate and how they interact.

A class diagram carries different information depending on the phase of the development process and the level of detail being considered. For example, initially, class diagram reflect the problem domain, which is familiar to end-users. As development progresses, a class diagram moves towards the implementation domain, which is familiar to software developers.

Guidelines for creating Class Diagram?

  1. Identify classes
    • a. From domain analysis such as textual analysis
    • b. From CRC cards
    • c. From use case description
    • d. From sequence diagram or use case scenarios
  2. Give analysis a name and a brief description which could be done through terms and glossary
  3. Structure classes in the right places of the diagram and related them with simple relationships
  4. As the development move forward, detail the class with attributes and operations, this often done in conjunction with use case and sequence diagrams
  5. Refine the class diagram with inheritance for future reuse
  6. Elaborate the details which is helpful for implementation such as accessibility, rules, constraints and etc.
  7. Put related classes into packages to form your software architecture

Why do we need Class Diagram?

Class diagrams are useful in many stages of system design:

  1. Analysis stage - a class diagram can help you to understand the requirements of your problem domain and to identify its components.
  2. Design stage - you can refine your earlier analysis and conceptual models into class diagrams that show the specific parts of your system, user interfaces, logical implementations, and so on.v
  3. Detailed design stage - the class diagrams that you create during the early stages of the project contain classes that often translate into actual software classes and objects when you write code.v
  4. Implementation stage - you can use class diagrams to convert your models into code and to convert your code into models.

Your class diagrams then become a snapshot that describes exactly how your system works, the relationships between system components at many levels, and how you plan to implement those components.

Keen to try VP Online?

No limitations, no obligations, no cancellation fees.


Start a Free Trial