开发者

what factors determine navigability of a relation while modelling

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 ??


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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜