![Page 1: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/1.jpg)
Stephenson College DP 98 1
Associations & Aggregations
by Derek Peacock
![Page 2: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/2.jpg)
Stephenson College DP 98 2
Associations
One to One One to Many Many to Many
0..1 10
Associates with
![Page 3: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/3.jpg)
Stephenson College DP 98 3
Uni-Directional Association
Switch Light bulbControls
ActorServer
![Page 4: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/4.jpg)
Stephenson College DP 98 4
Application Associations
Lecturer UnitsTeaches
Contract
Teaches to
*
Classroom
Taught in
*
*
![Page 5: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/5.jpg)
Stephenson College DP 98 5
Containment v. Containers
One object composed of fixed no of other objects
Can not exist without its components
e.g. a Car is composed of and engine, four wheels
One object may contain a variable no of other objects
Can exist independently
e.g. a Car Boot may contain some luggage, some books, some wine
![Page 6: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/6.jpg)
Stephenson College DP 98 6
Composition (of parts)
Clock
Hand Face Body
2
Battery
![Page 7: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/7.jpg)
Stephenson College DP 98 7
Aggregation
Parts can have independent life outside aggregation
e.g. a battery as part of a clock, as opposed to the hands of the clock
![Page 8: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/8.jpg)
Stephenson College DP 98 8
A Checkout Aggregation
Checkout
Barcodereader
Weighing scale
Till
CustomerQueue
![Page 9: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/9.jpg)
Stephenson College DP 98 9
The Solent Hotel
Has 5 function rooms @ £200 Has 40 bedrooms 10 single bedrooms @ £40 30 double rooms @ £55 One set of presentation equipment Customers name and payee recorded
![Page 10: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/10.jpg)
Stephenson College DP 98 10
UML Class Diagram (1)
Hotel
Single Room
DoubleRoom
FunctionRoom
Equipment
Is in0..1
10 30 5
![Page 11: Stephenson College DP 98 1 Associations & Aggregations by Derek Peacock](https://reader035.vdocuments.site/reader035/viewer/2022072014/56649ea95503460f94bacad3/html5/thumbnails/11.jpg)
Stephenson College DP 98 11
UML Class Diagram (2)
Single Room
DoubleRoom
FunctionRoom
Room CustomerBooks
0..1