UniDirectional Association
1 posts in topic
Flat View  Flat View

Posted By:   Raman_Murthy
Posted On:   Wednesday, October 17, 2001 09:54 PM

Can anyone tell when to use unidirectional association.

A code example

Posted By:   Rodrigo_Oviedo  
Posted On:   Tuesday, November 6, 2001 06:33 AM

The direction of an assoiciation has a lot to do with the visibility of the related objects.

For example, think about an unidirectional association from a class called A to another called B.

The code of A then will be something like:

public class A{

private B theB;



But B won't have any reference in code to A.

If the association is bidirectional,then the code of B will contain a reference to A.

I hope this helps.
About | Sitemap | Contact