aspose file tools*
The moose likes Java in General and the fly likes How do we implement Composition and Aggregation relation in code ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How do we implement Composition and Aggregation relation in code ??" Watch "How do we implement Composition and Aggregation relation in code ??" New topic
Author

How do we implement Composition and Aggregation relation in code ??

Abhineet Kapil
Ranch Hand

Joined: Feb 08, 2010
Posts: 44

Hi,,

I know both , compo and aggre are types of associations between classes. I know that composition is a strong relation .. aggre is a weak one..
eg. There is College, Departments, and Professors..
College class has a strong relation with Departments as the departments dont have individual existence..
But it has weak relation with Professors... Even after college is destroyed Professors may exist..

Please explain using a coding example how do we implement Composition and ho w do we implement aggregation ?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
 
jQuery in Action, 2nd edition
 
subject: How do we implement Composition and Aggregation relation in code ??
 
Similar Threads
How to differentiate among aggregation, association and composition?
How do u know which is composition and which is aggregation
Question about class diagram
Composition in Rational Rose 2001
Association Vs Aggregation Vs Composition