Aug 6, 2015
Understanding Association, Aggregation, Composition and Dependency relationship
relationship defines the connection between
objects. This explains how objects are connected to each other’s and how
they will behave.
Let’s take an example of relationship between Teacher and Student.
Multiple students can associate with a single teacher and a single
student can associate with multiple teachers. But there is no ownership
between the objects and both have their own lifecycle. Both can be
created and deleted independently.
Let’s take an example of relationship between Department and Teacher.
A Teacher may belongs to multiple departments. Hence Teacher is a part
of multiple departments. But if we delete a Department, Teacher Object
will not destroy.
Let’s take an example of relationship between House and rooms. House
can contain multiple rooms there is no independent life of room and any
room cannot belongs to two different house if we delete the house room
will automatically delete.
Let’s take another example of relationship between Questions and
options. Single questions can have multiple options and option cannot
belong to multiple questions. If we delete questions options will be
automatically deleted.
Let’s take an example of relationship between client and service. A
client is dependent on the service for implementing its functionalities.
Let’s take another example of relationship between a client and a
supplier. A client is dependent on the supplier for supplying products.
If the supplier will not supply the products, client cannot use those
products.
Labels:
JOB HUNT..!!,
OOPS Faqs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment