Monday, July 7, 2014

Association

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:
  1. One-to-One
  2. One-to-Many
  3. Many-to-One
  4. Many-to-Many

Rules

  1. The objects will have its own lifecycle and there is no dependent on other objects.
  2. The objects can act as an individual.

Symbol

EXAMPLE

To demonstrate the Association relationship in OOPs Concepts, consider the below two objects.
  1. Teacher
  2. 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