Class diagrams are fundamental to the object modeling process and model the static structure of a system.
The Unified Modeling Language (UML) enables you to describe complex systems, which you can view from a number of perspectives through diagrams. In the UML, class diagrams are one of six types of structural diagram. Depending on the complexity of a system, you can use a single class diagram to model the entire system, or you can use several class diagrams to model the components of the system.
Class diagrams are the blueprints of your system or subsystem. Use class diagrams to model the building blocks (or objects) that make up the system, to display the relationships between the objects, and to describe what those objects can do and the services they can provide.
Class diagrams are useful in many stages of system design. In the analysis stage, a class diagram can help you to understand the requirements of your problem domain and to identify its components. In an object-oriented software project, the class diagrams that you create during the early stages of the project contain classes that often translate into actual software classes and objects when you begin to write code. Later on, you can refine your earlier analysis and conceptual models into class diagrams that show the specific parts of your system, user interfaces, logical implementations, and so on. Your class diagrams then become a snapshot that describes exactly how your system works, the relationships between system components at many levels, and how you plan to implement those components.
Relationships in class diagrams show the interaction between classes and classifiers. Such relationships indicate the classifiers that are associated with each other, those that are generalizations and realizations, and those that have dependencies on other classes and classifiers.
Use class diagrams to visualize, specify, and document structural features in your models. For example, during the analysis and design phases of the development cycle, you can create class diagrams to perform the following functions:
During the implementation phase of a software development cycle, you can use class diagrams to convert your models into code and to convert your code into models.
Classes
In UML, a class represents an object or a set of objects that share a common structure and behavior. Classes, or instances of classes, are common model elements in UML diagrams.Objects
In UML models, objects are model elements that represent instances of a class or of classes. You can add objects to your model to represent concrete and prototypical instances. A concrete instance represents an actual person or thing in the real world. For example, a concrete instance of a Customer class represents an actual customer. A prototypical instance of a Customer class contains data that represents a typical customer.Classifiers
In UML models, classifiers are model elements that describe objects that are behavioral or structural features in a system.Notes and note attachment relationships
In UML models, a note is a diagram element that contains comments or textual information about a particular diagram element. Notes are connected to diagram elements using note attachments. You can add notes and note attachments to diagram types.Subsystems
In UML models, subsystems are a type of stereotyped component that represent independent, behavioral units in a system. Subsystems are used in class, component, and use case diagrams to represent large-scale components in the system that you are modeling.
Related tasks
Modeling static structure by using class diagrams