Aggregation & Composition: Show Additional Information


show more Aggregation is when one object contains another object, such as how a car contains a steering wheel. In contrast, composition is a more specific form of aggregation. It indicates that one objects owns another object. Follow along with this online programming video to learn about how you can use aggregation and composition to show relational and ownership information among classes. show less
please wait ...

Using aggregation and composition

We've already seen what are referred to as Associations in a diagram. Drawing any kind of line between objects simply suggests there is some kind of interaction. One object knows about or interacts with a different object. We can add a note to explain this, it might just be that one object is calling a method of another object. But we can get more specialized with what we're trying to illustrate. We've seen the way already that we show Inheritance with the empty arrow pointing at the superclass or parent class.

And we have another couple of terms here to explore and their supporting diagrams. We are going to talk about aggregation and composition, both are very long words for simple ideas. And they describe an obvious relationship between our objects that one object can often be built of other objects. So Aggregation is often referred to as a HAS A relationship as opposed to the IS A relationship of Inheritance. We would never say something like a customer is a address, but we might say ...

Using aggregation and composition
Video duration: 3m 55s 3h 1m Intermediate

Viewers:

Aggregation is when one object contains another object, such as how a car contains a steering wheel. In contrast, composition is a more specific form of aggregation. It indicates that one objects owns another object. Follow along with this online programming video to learn about how you can use aggregation and composition to show relational and ownership information among classes.

Subject:
Developer
Software:
Java
Author:
please wait ...