ag·gre·ga·tion
1 : a group, body, or mass composed of many distinct or varied parts or individuals
2 : the collecting of units or parts into a mass or whole
2 : the collecting of units or parts into a mass or whole
Biology, Ecology. a group of organisms of the same or different species living closely together but less integrated than a society.
com·po·si·tion
1 : the act of combining parts or elements to form a whole.
2 : the resulting state or product.
3 : manner of being composed; structure: This painting has an orderly composition.
4 : makeup; constitution: His moral composition was impeccable.
Studio,
I would like to clarify some of the concepts behind aggregation and relate it to what you have already learned from first year which is composition. Aggregation is the concept and process of replicating and collecting a part/cell/module to form a larger body. Similar to composition there is a part to whole relationship, but with aggregation the whole is much more dependent on the parameters of the part. With composition, the whole is often defined first and then the parts are “composed” to produce the overall effect. In aggregation the part is defined and constructs the whole from the parameters of collection. Thus, with aggregation the whole is constructed from a family of parts - alluding to the notion that while these parts may sometimes look extremely different there is a foundation syntax embedded in all of them.
There is also a dependency difference between aggregation and composition. With composition you have been taught that if you take away from or add to a well composed whole, the system fails. With aggregation, the relationships are not so co-dependent. If you take a component away, the whole can reorganize and re-stabilize.
There is also a dependency difference between aggregation and composition. With composition you have been taught that if you take away from or add to a well composed whole, the system fails. With aggregation, the relationships are not so co-dependent. If you take a component away, the whole can reorganize and re-stabilize.
Here are two explanations of aggregation and composition that could relate to architecture but are actually extracted from a computer programming handbook:
Aggregation is a kind of association that specifies a whole/part relationship between the aggregate (whole) and component part. This relationship between the aggregate and component is a weak “has a” relationship as the component may survive the aggregate object. The component object may be accessed through other objects without going through the aggregate object. The aggregate object does not take part in the lifecycle of the component object, meaning the component object may outlive the aggregate object. The state of the component object still forms part of the aggregate object.
Composition is a kind of association very similar to aggregation except where the composite object has sole responsibility for the disposition of the component parts. The relationship between the composite and the component is a strong “has a” relationship, as the composite object takes ownership of the component. This means the composite is responsible for the creation and destruction of the component parts. An object may only be part of one composite. If the composite object is destroyed, all the component parts must be destroyed, or the reference and responsibility of the component part must be handed over to another object. Composition enforces encapsulation as the component parts usually are members of the composite object.
No comments:
Post a Comment