INTRODUCTION
- Association used to denote the relationship among objects in your application
- It defines the what relationship maintained with other objects.
- The types relationship are:
- One-to-One
- One-to-Many
- Many-to-One
- Many-to-Many
Rules
- The objects will have its own lifecycle and there is no dependent on other objects.
- The objects can act as an individual.
Symbol
EXAMPLE
To demonstrate the Association relationship in OOPs Concepts, consider the below two objects.
- Teacher
- Student
Rule 1 - Own life Cycle
- A Teacher should belong to at least one department and he can handle one or more subjects.
- A Student will have different subjects.
Rule 2 - Act as an individual
- The relationship between Teacher and Student is Strong. They can act as an individual instead tightly coupled.
SUMMARY
The objects are in Association relationship are loosely coupled. One is not dependent on other.
No comments :
Post a Comment