• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Abhineet Kapil
Ranch Hand
Posts: 52
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic