Wednesday, April 13, 2016

Class Diagrams

Class diagrams describe the types of objects in a system, as well as the static relationships that exist between them. A simple example (from agilemodeling.com) is given below:


In practice, most UML diagrams are class diagrams. That said, there are other kinds of diagrams such as activity diagrams.

Notice that each class is represented by a rectangle, further subdivided into one or more parts. In this case, all classes happen to be subdivided into three parts. At the top is the name of the class, followed by the attributes of the class, and finally,  the functions of the class.

Furthermore, the class diagram gives information about relationships between classes. Intuitively, we see that a person "lives at" an address. Here, the multiplicity is also givena person lives at an address, and an address can be associated with a minimum of 0, or a maximum of 1 person.

This explanation barely scratches the surface of class diagrams. If you want to learn more, agilemodeling has a great guide.


No comments:

Post a Comment