views:

21

answers:

2

what factors determine navigability of a relation while modelling , canonincal example Company m..n People. what should be the direction of navigability in this relation ??

+1  A: 

It depends on your requirements: if you need to query the people working at a company and/or the company in which some person works.

More concretely, if your implementation language is Java, if you need a field of type Set<People> in class Company, you have navigation from Company to People, and if you need a field of class Company in class People, you have navigation from People to Company.

Maurice Perry
A: 

This is a design decision. At the analysis level you usually model all associations as bidirectional associations but, later, when moving to the implementation phase you need to start thinking about how to transform associations into Java attributes (if implementing in Java) and here the navigation play an important role since you must decide whether you want to access people objects from company (attribute people in company), company objects from people objects (attribute company in people) or both (attributes in both classes but be careful with consistency issues)

Jordi Cabot