Saturday, October 3, 2009

Patterns - 031: Structural patterns ( Aggregate Enforcer )

In general, classes are designed to carry related data and offer focused functionality. Sometimes an object may contain other objects as part of it. Such an object, which is a union of other objects, is called an aggregate object.

The Aggregate Enforcer pattern recommends that when an Aggregate object is constructed, it must be constructed in full or is not created at all.

There are two types of aggregate relationships — aggregation and composition. In both of the relationships, an Aggregate object is composed of several constituting objects.

  • In the case of aggregation, the parts that make up the Aggregate object can exist meaningfully without the parent Aggregate object.
  • Composition is a stronger form of aggregation. The set of constituting objects in a composition relationship with the parent Aggregate object cannot exist meaningfully on their own without the Aggregate object.

(aggregater_enforcer)


NOTE : DO THE OTHER LISTING NOTES


No comments:

Post a Comment