Class Diagram Example: Telephone (Use of Association)


This class diagram shows the object model of a telephone. It shows the use of aggregation and composition in representing the kind of association between classes.

You can edit this Class diagram template to reflect your own structure. Just click Use this Template to start.

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

Purpose of Class Diagram

Class diagrams is widely used model for visualizing, specifying, and documenting structural features at different levels of details in software development process and they can help to achieve many benefits for your team, for example:

  • Capture and define the structure of classes together with other related classifiers.
  • Establish relationships between classes and classifiers.
  • Elaborate the class structure of a model by using attributes, operations, interface and etc.
  • Illustrate the common classifier roles and responsibilities that define the behavior of the system.
  • Organize the implementation classes in a package.
  • Refine an inheritance hierarchy among classes and classifiers for better reuse.
  • Refine class diagram from use case diagram or sequence diagram and establish the traceability among them.

Keen to try VP Online?

No limitations, no obligations, no cancellation fees.

Start a Free Trial