In the next video, you will learn about aggregation relationship between different classes.
In the previous video, you learnt what an aggregation relationship is. In an aggregation relationship, an object of one class (whole object) will contain objects of other classes (part objects). But when the whole object is deleted, part objects will not be deleted. An aggregation relationship has an association name and multiplicity associated with it.
Aggregation. Aggregation relationship between two classes denotes a contains relationship. If one class contains another class, it would be called as an Aggregation with a special condition. In this case, let's take an example to understand it better. An Admin could have multiple inventory managers reporting to them. In our example, as we have been seeing, an Admin could have say minimum of five to maximum 20 inventory managers reporting to them. So an Admin contains a set of inventory managers, but it could be possible that an admin could leave the job today and there could be another Admin replacing the same position. And the inventory managers who are reporting to the previous admin is now going to report to the new admin, in this case, the admin object, even if it gets deleted. The inventory manager objects should not get deleted. So the inventory manager should exist independently, even if the admin object gets deleted. So such a relationship is called as Aggregation, where class A contains class B, but class B exists independently. Such a relationship Aggregation is represented with an unfilled diamond arrow which ends with a class which contains the the other classes you can see as in the example, the admin and inventory manager has an Aggregation relationship which has a one to many relationship as well.
Aggregation denotes a contained relationship between two classes.
It means one class contains another class, but the contained class can exist independently.
An example is given where an Admin has multiple inventory managers reporting to them.
If the Admin leaves the job, another Admin can replace them, but the inventory managers should exist independently.
Aggregation is represented by an unfilled diamond arrow that ends with the class containing the other classes.
In the example, the Admin and inventory manager have an Aggregation relationship with a one-to-many relationship.
In the next video, you will learn about composition relationship.
In the previous video, you learnt about composition relationship. In a composition relationship too, an object of one class (whole object) will contain objects of other classes (part objects). But in a composition relationship, when the whole object is deleted, part objects will also be deleted. A composition relationship has an association name and multiplicity associated with it.
So far you have learned about the Aggregation and Composition Relationship.
In this segment, you learnt about the aggregation and composition relationship between different classes and how to represent them in the Class diagram.