SE450: Basics: UML Notation for References [35/63] Previous pageContentsNext page

In the UML, references are usually shown using arrows.

Instead of this:

   +--------------+       +-----------------+
   | i0 : MutInt  |       |  0 : Main.main  |
   | ------------ |       |  -------------  |
   +--------------+       +-----------------+
   |   v:int = 42 |       | vi:int = 27     |
   +--------------+       | vj:int = 27     |
                          | ri:MutInt = i0  |
                          | rj:MutInt = i0  |
                          +-----------------+

We draw this:

   +--------------+       +-----------------+
   | i0 : MutInt  |   ri  |  0 : Main.main  |
   | ------------ | <---- |  -------------  |
   +--------------+   rj  +-----------------+
   |   v:int = 42 | <---- | vi:int = 27     |
   +--------------+       | vj:int = 27     |
                          +-----------------+

Previous pageContentsNext page