An aggregation is a stronger form of relationship where the relationship is between a whole and its parts
Student Schedule Aggregation Whole Part
Aggregation-Composition
Composition is a form of aggregation with strong ownership and coincident lifetimes of the part with the aggregate
Student Schedule Aggregation Whole Part
Aggregation- Dependency
A dependency relationship is a weaker form of relationship
Aggregation-Generalization
A specialization/generalization relationship is one, in which objects of the specialized element (the child) are substitutable for objects of the generalized element (the parent)
Superclass
Subclass
Association
Association is a connection between classes
Professor University Professor University Works for Class Association Name Role Names Employer Employee
Constraints of Association
An association may have a name that is placed on, or adjacent to the association path
The name of the association should reflect the purpose of the relationship and be a verb phrase; the name of an association can be omitted, particularly if roles names are used. Names like “has” and “contains should be avoided”, as they add no information about what the relationships are between the classes.
Each end of an association is a role specifying the face that a class plays in the association (not a constraint). Each role must have a name, and the role names must be unique. The role name should be a noun indicating the associated object’s role in relation to the associating object.
The use of association names and role names are mutually exclusive: one should not use both an association name and role name. For each association, it needs to decide as to which conveys more information.
0 comments
Post a comment