Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

aggregation vs composition

 
Vzy Mar
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Just I wanted to know more details about the Composition. As per my understand, Composite object is made of the components. Or Components doesn't have any value without Composite object.

I would like to know that, Is above example will come under the Composition?.

 
Vzy Mar
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
corrected
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aggregation. Aggression means something else completely.

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

You can edit your post by using the button.
 
Vzy Mar
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

Thank you for correcting me on post. I was in hurry while posting the question, never repeat the mistake again.
 
Vlad Varnica
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can download an UML modeling tool and reverse your java code.
You will immediately see if it is detected or not as an aggregation.

btw, you code is for me a 1 to 1 association.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic