View RSS Feed

Java Object

Composition and Aggregation using Java

Rate this Entry
by , 04-26-2012 at 06:15 PM (2543 Views)
Always, there exist a confusion b/w aggregation & composition. In case of a practical field of aggregation and compostion, it shall be kept in minf that both of them are of association type. Below is given the definition of term. After that practical java code is given so that to exactly understand that how aggregation and composition implementation could be implemented in programming.

Composition:
Objectís life time is considered to be the same. For instance, composition is present b/w a car and a car frame. In case of destruction of car, the car frame will also be destructed.

Aggregation:
Objectís life times are not similar. Even after the destruction of other object there is the possibility present of presence of other object.

Submit "Composition and Aggregation using Java" to Facebook Submit "Composition and Aggregation using Java" to Digg Submit "Composition and Aggregation using Java" to del.icio.us Submit "Composition and Aggregation using Java" to StumbleUpon Submit "Composition and Aggregation using Java" to Google

Categories
Composition

Comments