During the course of this class so far I've found aggregation classes to be a bit difficult to understand and so I set out to find out more about them and understand them better. The following is what I could find out with the limited research time I have:
Aggregation Associations
1. Aggregation is similar to normal associations but is considered a "specialization of assocation".
2. It is a specficiation of a "whole-part" relationship between two objects.
3. An aggregation association represents an "is part of" relationship (i.e. an engine is part of an airplance)
4. Composition is also a special kind of association and has a stronger form of ownership between the whole and it's part. Specifically it has "coincident lifetime of part with the whole". This means that the lifetime of an object is dependent on another object, or in other words if the whole is destroys so is the part(s). For a better explanation of composition and what it means to have a coincident lifetime see source 3, 4 and 6. (You can also search "compositon coincident lifetimes" on google for a myriad of references.)
5. Aggregation is considered to be a weaker association than composition
6. It's notation is with a diamond on the end touching "whole" class and the other end touching the "part" class.
7. According to source 5 there is not much different in the implementation of aggregation classes and normal association classes. (if anyone would like to argue that feel free, I don't know enough of the specifics of implementation to argue either way).
8. The aggregation class object that you create can have more than one set with different attributes as opposed to the normal association class that must have a 1 to 1 relationship.
9. Each object set of the aggregation class does not have to be unique so you can have multiple instances of an object, each with their own attributes.
Sources:
1. http://faq.javaranch.com/java/AssociationVsAggregationVsComposition
2. http://www.agilemodeling.com/style/classDiagram.htm#AggregationComposition
3. http://www.jguru.com/faq/view.jsp?EID=51520
4. http://www.coderanch.com/t/412398/Beginning-Java/java/Association-Composition-Aggregation
5. http://www.objectmentor.com/resources/articles/umlClassDiagrams.pdf
6. http://www.geekinterview.com/question_details/40852
7. Gmail conversation with group member (not available)
Tuesday, October 27, 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment