Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
http://ecomputernotes.com
Multiple Inheritance
We
http://ecomputernotes.com
Mermaid
Woman
Fish
Mermaid
http://ecomputernotes.com
Amphibious Vehicle
http://ecomputernotes.com
Car
Amphibious Vehicle
http://ecomputernotes.com
Boat
complexity
understanding features
Duplicate
http://ecomputernotes.com
Fish
Mermaid
Which
Fish
Mermaid
eat
http://ecomputernotes.com
Land Vehicle
Water Vehicle
Car
Which
Amphibious Vehicle
Boat
Vehicle inherits?
Others
http://ecomputernotes.com
Association
Objects
other
Usually
an object provides services to several other objects object keeps associations with other objects to delegate tasks
http://ecomputernotes.com
An
Kinds of Association
Class
Association
Inheritance
Object
Association
Simple Association
Is Is
a reference by which one object can interact with some other object simply called as association
http://ecomputernotes.com
Is
navigation
number of objects
One-way Association
We
can navigate along a single direction only by an arrow towards the server object
Denoted
http://ecomputernotes.com
Example Association
Smith
lives-in
1 1
House
Smith
lives in a House
http://ecomputernotes.com
Example Association
Smith
drives
1 *
Car
Smith
Two-way Association
We
Denoted
objects
Employee
works-for
* 1
Company
Employee
Movis
friend
1 1
Smith
Movis
Binary Association
Associates Denoted
Employee
works-for
* 1
Company
Association
Smith
drives
1 *
Car
Association
two classes
Ternary Association
Associates Denoted
Teacher 1
Course
Objects
Language *
Person
Objects
N-ary Association
An
Practical
Composition
An
object may be composed of other smaller objects The relationship between the part objects and the whole object is known as Composition Composition is represented by a line with a filled-diamond head towards the composer object
Arm
Smith
Leg
1 Body
Chair
2 Arm
1 Seat
4 Leg
Composition is Stronger
Composition
Composed object becomes a part of the composer Composed object cant exist independently
Aggregation
An
object may contain a collection (aggregate) of other objects The relationship between the container and the contained object is called aggregation Aggregation is represented by a line with unfilled-diamond head towards the container
Example Aggregation
Bed 1
Chair
Room
Table
1 Cupboard
Example Aggregation
Garden
Plant
Aggregation is Weaker
Aggregation
Aggregate object is not a part of the container Aggregate object can exist independently
can be shifted to another room, and so can exist independent of a particular room
can be planted in some other garden, and so can exist independent of a particular garden