Association

The association relationship maintains a has a kind of relationship between the objects of the classes. The has a relation can either be one-to-one or one-to-many. In the following example, we can see that there is a one-to-one association relationship between the Employee and Manager classes, as an Employee would only have one Manager class. We also have a one-to-one association relation between Employee and Department. The reverse of these relationships would be one-to-many relationships as one Department class might have many employees and one manager might have many employees reporting to them. The following code snippet depicts the association relationship:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.79.88