A UML class diagram describes the structural design of software types.
An object diagram answers:
A class diagram answers:
For a soccer system, a class diagram might contain:
The top compartment identifies the class.
The next compartment can list fields/attributes.
Methods are added later in PC1.
A class diagram might show:
jerseyNumberAn object diagram might show:
jerseyNumber = 7The class diagram describes structure shared by Player objects.
The object diagram shows the current state of one specific Player instance.
If Player objects can refer to Team objects, the class model can show a structural relationship between:
Playerand:
TeamAt this stage, focus on recognizing that the two types are related.
More detailed relationship notation is not needed to learn the basic class model.
A class diagram can guide C# questions such as:
The diagram is a design representation.
The C# class definition is the implementation representation.
Do not add:
Model only the structure required by the current purpose.
A simple accurate class diagram is more useful than a complicated diagram containing future concepts.