In this example we will be focusing on the relationship between object instantiation and constructors based on the code below. The first snip is the MainWindow and the second snip is in the Employee class.
Representing this in a sequence diagram is shown below.
Note that this is different than how it is represented in the instructions. We are working on transitioning between an old way of representing it to this new way.
To create this in Violet, create an 'Object lifeline' with the name of the object being instantiated followed by the class name (objectName: ClassName). This object lifeline will sit at the top of the diagram.
Then, draw a 'Call/Create message line from the activation bar it is being instantiated in to the 'Object lifeline' node. This will cause the 'Object lifeline' node to drop to the same level. On the call line, put the 'call' to the Employee constructor.