This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Question about composition Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "Question about composition" Watch "Question about composition" New topic
Author

Question about composition

Ted Bell
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
Hi all,
While preparing part II, I came across this question with regard to composision.
UML Distilled (page 86, figure 6-6 in my copy) has a composition relationship between Point and Polygon, and explains that "deleting a Polygon would cause its associated Points to be deleted...".
Reviewing Cade's study guide and his class diagram in the case study (page 169, figure 8-6), I would have tought there would be a similar relationship between Order and LineItem. Would removing an Order not also remove the LineItems associated with it? If not composision, would this not at least be aggregation? Meaning that an Order it made up of LineItems, but that a LineItem can exist after an Order is deleted (to preserve the relationship between LineItem and Product)?
Just trying to get a better handle on this so I get my relationships correct in my asssignment. Thanks for any help.
Art
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
You answered the question yourself. If deleting the order does not delete the LineItems, then it is not a composition but an aggregation. But you have to understand, this comes from the business requiremnets. ie., whether or not the relationship is a composition( or an aggregation) is driven by the business requirements and not the other way.
Hope that helps,


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about composition
 
Similar Threads
BMP relations
Relations in BMP
How do u know which is composition and which is aggregation
Domain class design question
Mysql auto generated PK used for another table and JPA