This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementation of Association and Aggregation Relationships.

 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Folks,

I have a doubt on implementing an aggregation relationship.

By definition an aggregation is strong type of association. In the definition there is no any indication about multiplicity of both association or aggregation. So according to that implementation (java code) of association and aggregation relationship should be same.

But in real world and examples give for these relationships, aggregation has always many (*) relationship at least in one side while association has always a one to one. My understanding according to definitions is an Association can be both O2O and O2M for an example "A class has a Teacher and A class has Many students", as well as Aggregation can be both both O2O and O2M ( one side is the aggregator ) for an example "Teacher is a part of Class and Students are part of Class". Here I gave the same example for both association and aggregation because If i hvn't not misunderstood, defining a relationship as an association or an aggregation is specific to domain or context.

Can someone please explain why all most all examples for aggregation indicate a many relationship (using a Collection like List, Map etc.. ) or is my understanding wrong?

Thanks
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your understanding is correct.

One example is an order has a billing address. This is one-to-one relationship. A Billing address is a aggregate.
Please notice that the address part can be shared.

There is a stronger form called Composition, for example I am composed of a heart which cannot be shared, otherwise I will die.

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic