Please see my other Object-Oriented Programming (OOP) articles.
Leveraing UML to Describe Classes
Free UML Tool: https://www.visual-paradigm.com/solution/freeumltool/
In my OOP Class Design article, I basic principles for designing a class. At the end of the article I used a UML diagram for the class to describe its characteristics which I’ll describe in this article.
The Unified Modeling Language (UML) was created to efficiently describe scenarios and their characteristics.
In software projects, using UML diagrams provides a very quick way to communicate all aspects necessary for collaborative development among a team.
In the following two images I illustrate code from the Employee class and a UML diagram describing that class.
UML Conventions
UML Software classes are contained in a box divided into three sections, each divided by a line:
- (top) Class name
- (middle) Attributes: This section describes a class’ data, note the minus sign which denotes a private class member, only accessible within the class.
- (bottom) Methods: This section describes a class’ behavior, note the plug sign which denotes a public class member, accessible from a class’ objects. Class methods are typically used to access class attributes.