Class Diagram
A class diagram is a UML diagram that describes the structure of a domain or a system using entities modeled as classes, along with the relationships that exist between them.
Class diagrams are used for:
- High-level conceptual modeling (domain model)
- Data modeling, where they describe how data is presented or stored in a system
- Modeling objects that represent the actual internal design of object-oriented systems
The aim of this chapter is not to provide a comprehensive class diagram reference. Its goal is simply to introduce the basics. Nevertheless, from an analytical perspective, the basics should be sufficient in most cases, as long as the analysis does not include detailed system design.

The class diagram above depicts:
- 4 classes representing the 4 main entities managed by the system:
Order, Order Line, Product, Customer - Class attributes that define the data managed by each class. For example, the
Productclass is defined by the product name and its serial number, both being of a string data type.- Since a class diagram can be purely conceptual or include concrete implementation constructs, the same applies to data types. Domain models, for instance, might use abstract data types like
AddressorMoney, or no data types at all. Design classes, on the other hand, reflect the underlying technology and use real Java or C# data types.
- Since a class diagram can be purely conceptual or include concrete implementation constructs, the same applies to data types. Domain models, for instance, might use abstract data types like
- An enumeration – a data type whose instances can only be one of the predefined values.
- Relationships that indicate logical connections between classes.
- For instance, the
Customerclass is in a relationship with theOrderclass, expressing that a customer has created one or more orders. - More specifically, a customer can have 0 or N (the
*symbol) orders in the system, but each order belongs exclusively to one customer. This is called multiplicity. - Another class diagram feature is navigability. It is indicated by the arrows on the edges of a relationship. It is possible to navigate from the
Customerclass to theOrderclass, which means that in the object-oriented application, it is possible to callCustomer.getOrders()to look up all of a customer's orders. However, it does not work the other way around; instead of callingOrder.getCustomer(), a developer would need to look up customers by querying the database. TheCustomerclass includes a collection of orders, but theOrderclass does not include a reference to the customer who created it. Navigability is an advanced topic, however, and is not necessary for the needs of Effective Analysis. - Note: All relationships in this diagram are modeled as associations. To be more specific about the semantics of each relationship, associations could be transformed into either aggregations or compositions. They are described in a separate chapter.
- For instance, the
What differentiates classes from plain data structures is that, besides data, classes also include operations for manipulating that data. For the sake of simplicity, these are not included in the provided diagram.

