Professional Documents
Culture Documents
Relationships
Association
Aggregation Composition
Relationships: Association
Models a semantic connection among classes
Association Name
Professor
Works for
University
Association Class
Role Names
Professor
Employee Employer
University
Aggregation
Aggregation is a kind of association used to model whole-part relationships between things. The whole is called the composite.
Relationships: Aggregation
A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts Part
Whole
Student
Schedule
Aggregation
Relationships: Composition
A form of aggregation with strong ownership and coincident lifetimes
The parts cannot survive the whole/aggregate
Whole Part
Student
Schedule
Aggregation
1. Aggregation Vs Composition
UML aggregation is weak containment, usually implemented with pointers, and the symbol is an open diamond. Composition is strong containment, implemented by value, and the symbol is a filled diamond.
Aggregation Vs Composition
An aggregate object is one which contains other objects. For example, an Airplane class would contain Engine, Wing, Tail, Crew objects. Sometimes the class aggregation corresponds to physical containment in the model (like the airplane). But sometimes it is more abstract (e.g. Club and Members). The test for aggregation is to see if there is a whole/part relationship between two classes . A synonym for this is part-of.
Student
0..*
Schedule
Navigation
Relationships: Dependency
A relationship between two model elements where a change in one may cause a change in the other Non-structural, using relationship
Class
Client Supplier
Component
Package
Dependency relationship
Client
Supplier
ClientPackage
SupplierPackage
Dependency relationship
Relationships: Generalization
A relationship among classes where one class shares the structure and/or behavior of one or more classes Defines a hierarchy of abstractions in which a subclass inherits from one or more superclasses
Single inheritance Multiple inheritance
Superclass (parent)
Generalization Relationship
Checking
Subclasses
Withdraw()
Descendents
Animal
Airplane
Helicopter
Bird
Wolf
Horse
Use multiple inheritance only when needed, and always with caution !
Superclass (parent)
weight licenseNumber
register( )
owner 0..* 1
Person
generalization
Subclass
Car size
Trailer
seller
buyer
item sold
shipping mechanism
Salesperson
Customer
Product
Vehicle
Corporate
Individual
Truck
Train
seller
buyer
item sold
shipping mechanism
Salesperson
Customer
Product
Vehicle
Corporate
Individual
Truck
Train
Airplane