简体   繁体   中英

Meaning of association in a UML class diagram

在此输入图像描述

0...1 next to Plane class means that an instance of Flight is associated with either none or one instance of Plane. But Flight class has no attribute member of type Plane.

So where will such association Flight-->Plan be seen in the system? What does it mean exactly "being associated" in a UML class diagram?

I would simply link to JimL's answer here , which links to Geert's blog. In short: associations ARE the attributes. They are just a different (better) rendering of the same thing.

In your example the two assign* association end names are properties in the opposing class.

Associations with dot on the end, according to the UML standard (B3.2 section), could mean that they are attributes.

Associations with usual arrows or without them, mean only existing NAVIGATION from one class to another. That can mean, if class A has association to B, that:

  1. A has B instance as a property.
  2. A has instance B as a local variable.
  3. A has some reference (to reference...) to some instance to B and USES it (having simply reference to some class C that has association to B is not enough)
  4. A has a method returning B instance.
  5. There could be a collection or array of B instances instead of a single B instance.
  6. A has some of the previous navigable ways to B, but we don't specify which of them. (unspecified navigation)

The last edition of the 2.5 standard gives several ways to set the rules for showing arrows and crosses on the ends of an association (11.5.5), but never can it be limited to properties only.

Read the standard, no blogs. Internet folklore knowledge on the UML is very, very poor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM