Class Diagram Example: Self Association

Description:

Self-association is a special type of UML association. Instead of connecting two classes, a self-association has same class as its source and target. An example is shown in this class diagram example.

If you just need to create an Class diagram, you can start with this diagram template or create one from blank.

What is Class Diagram?

The class diagram is an important part of the UML, as it captures the static view of the system. The class diagram models classes in the real world and specifies the relationships between them. A class is essentially a template from which any number of objects can be derived. It does not exist as an object in its own right, but it defines the properties (or attributes) that an object will have, and the operations that can be performed by the object. We can also use packages represent groups of related classes and relationships.

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 diagrams?

  • Plan and model requirements ahead of time make implementation much easier in subsequently phases.
  • Modify class diagrams quite is easy, whereas the actual code for features.
  • Plan for a house (not a simple dog house) to have a blueprint, before grab a hammer and nail to get work done.
  • Class diagram is quite easy to understand and to be used to communicate with other stakeholders for team afford.

Keen to try VP Online?

No limitations, no obligations, no cancellation fees.


Start a Free Trial

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

OK