Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you show instantiation in a UML Sequence Diagram?

Tags:

How do I show that the WebServer instantiates a View and gets back control of the flow? Maybe I'm not using the right type of diagram? Thanks a bunch!

alt text

like image 634
LeWoody Avatar asked Jan 24 '10 16:01

LeWoody


People also ask

How do you represent objects in a sequence diagram?

In the UML, an object in a sequence diagram is drawn as a rectangle containing the name of the object, underlined. An object can be named in one of three ways: the object name, the object name and its class, or just the class name (anonymous object). The three ways of naming an object are shown in Figure below.

How are messages indicated on UML sequence diagrams?

Messages are shown on UML diagrams as labeled arrows, with the arrowhead indicating the direction of the call. When a message is sent to an object, the text associated with the message specifies the name of the method that is being called on the receiving object.


1 Answers

The diagram from Ruben's answer is correct, but general UML answer is missing. It creates the other lifeline when the "create" line (dashed in this case) connects to the box/label/top of the created life line. From example: WebServer in it's action creates a View and the action done by the view creates the Widget.

-----
| a |
-----
  |
  []---->-----
  []     | b |
  |      -----
  |        |

There are also several diagrams here.

The UML 2.2 specifications (superstructure) has an example on page 474, Figure 14.11 is their canonical syntax/notation reference. And on page 495 in the notation section it states "Object creation Message has a dashed line with an open arrow." This is further defined in the UML as the message type is an enumeration called MessageSort. One value is:

"• asynchSignal - The message was generated by an asynchronous send action.createMessage - The message designating the creation of another lifeline object."

like image 182
Ted Johnson Avatar answered Nov 09 '22 01:11

Ted Johnson