English 中文(简体)
Association of n to 1 objects in a UML class diagram
原标题:

Is it safe to say that in a UML class diagram, if there is an association of n to 1 objects, then the association arrow is pointing from the class associated with n objects to the class associated with 1 object?

n ----> 1

问题回答

Not in general. The arrow direction in UML corresponds to navigation possiblities. Hence, if your arrow points from the n objects to the 1 object it means that in your resulting code each of the n objects can access that 1 object. Of course you may also want an association in which that 1 object can access the n objects, so the arrow points in the different direction. (If no arrowhead is given it means that the n objects can access the 1 object and vice versa.)

Not precisely. It depends on the type of association. If its an aggregation then the default is bi directional navigability, but you can specify the navigation to be one way. I think that it is entirely up to the designer to decide the direction of the navigation between objects.

No. At least in object oriented programming, the one class that has the "1" association (reference in OOP) could equally well have the many references to the other class.

It depends on the design you make.

I thought the arrow was more about navigability (i.e. an arrow from A -> B shows that class A knows how to get to B but B does not know how to get back to A) than expressing the cardinality of the relationship.

If I can suggest, there are 3 different notions: 1 - Navigability which is modeled by arrow 2 - Cardinality which is modeled by number or star for 0..n 3 - to who belongs the end point of the association which is modeled by a dark point please see extracted from the norm.Examples of class-owned ends





相关问题
Understanding UML of DoFactory Design Pattern - Decorator

I am trying to understand UML diagram describing Decorator Pattern at link below http://www.dofactory.com/Patterns/PatternDecorator.aspx I don t understand why there is a "Aggregation" relation ...

UML Code generation tool in C# [closed]

Please suggest me any opensource tool to generate C# code from UML designer,Or any plugin to generate code from visualstudio. My requirement is to have a code generation tool for C#.

How to design/plan for web application development?

I m interested in learning how to design/plan for web application development, in a multiple developer team scenario. Assuming the role of "Project Manager/Lead": What "documents" are needed for ...

Software for Sequence Diagrams? [closed]

I ve been using NClass for object/class modeling in class thus far. However, I do not believe that it is capable of sequence diagrams, which is my next task. I would prefer not to use Visio. Is ...

UML Diagram to Model API

I need to create a diagram to document a RESTFul API that build, which UML diagram should I use? Thanks in advance,

Where could I find some UML samples? [closed]

I need a punch of samples of UML diagrams to get an start point to develop my own diagrams. Does anyone know about a good website where I could find it? Thanks!

热门标签