Software Engineering - Old Questions
11. Explain class diagram with example.
A class diagram is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects.
A UML class diagram is made up of:
- A set of classes and
- A set of relationships between classes
Class
A class is a description of a group of objects all with similar roles in the system. A class notation consists of three parts:
Relationships
A class may be involved in one or more relationships with other classes. A relationship can be one of the following types:
1) Generalization: A generalization is a relationship between a parent class (superclass) and a child class (subclass). In this, the child class is inherited from the parent class.
2) Association: This kind of relationship represents static relationships between two classes.
3) Aggregation: Aggregation is a special type of association that models a whole- part relationship between aggregate and its parts.