Difference between revisions of "Aggregation"

esse quam videri
Jump to: navigation, search
(Created page with " =Definition= =Relevance= =Explanation= =Resources= == See also == ==Notes== ==External Links== Category:Programming Language Concepts Category:Object Orien...")
 
Line 1: Line 1:
  
 
=Definition=
 
=Definition=
 +
In object-oriented programming, aggregation is a whole/ part relationship between objects or classes. Class aggregation can correspond to physical containment in a model, such as a car that has an engine, doors, and windows. Class aggregation can also correspond to abstract containment such as a club and members. This relationship does not imply ownership, however.
  
 
=Relevance=
 
=Relevance=
  
 
=Explanation=
 
=Explanation=
 +
Aggregation can be done by value or by reference. By value means that the two objects have the same lifespan and parts cannot be interchanged. By reference allows parts to be interchanged because the objects have been de-coupled. Another way to think of Aggregation is Object A “uses” Object B.
  
  
 +
=Resources=
  
=Resources=
 
 
== See also ==
 
== See also ==
  

Revision as of 21:36, 21 June 2019

Definition

In object-oriented programming, aggregation is a whole/ part relationship between objects or classes. Class aggregation can correspond to physical containment in a model, such as a car that has an engine, doors, and windows. Class aggregation can also correspond to abstract containment such as a club and members. This relationship does not imply ownership, however.

Relevance

Explanation

Aggregation can be done by value or by reference. By value means that the two objects have the same lifespan and parts cannot be interchanged. By reference allows parts to be interchanged because the objects have been de-coupled. Another way to think of Aggregation is Object A “uses” Object B.


Resources

See also

Notes

External Links