I have a Class diagram where I have created some classes.
Then I have an Object diagram where I have instantiated these Classes (Instance specification).
Then when I create a Sequence diagram I was expecting to be able to select my Objects for “Base Classifier”, but I can only select my Classes. Is this expected?
If I create multiple objects from the same class, how can I in a Sequence Diagram show which of the objects I work with?
If there is a “advanced” guide how to best model a state machine implemented inside a class - please share a link. Ideally I would like to be able to clearly show the current state of the state machine in a Sequence Diagram (automatically or manually)
Thank you for your inquiry. Both a lifeline and instance specification (in an object diagram) are instances of a classifier. The following video shows you how to select a class to be the base classifier of a lifeline
Besides the steps demonstrated in the video, you can also drag and drop a Class onto a sequence diagram to create lifelines.
You can give different names to different lifelines.
Please read the articles below.
Thank you Jick
I started to look at the State machine tutorial which was very helpful.
Up until now I have manually edited the caption of each transition (so the operation name is shown).
Now I can use “Call trigger” and associate it with an operation of the class. This is just like I want it. Very promising!
But I discover one small problem. When I hit “Open specification” for a Transition and show Triggers, they all have a manually edited Name. If I do not enter a Name, it will remain blank. And this Name is shown in the State Machine Diagram.
Is there a way to automatically show the Name from the Trigger here, or by default fill the Name to match the associated operation? This would save some work and also ensure consistency if the operation later is renamed.
Or should perhaps the Triggers be pre-created in some other Diagram type? I must say I do not yet have a clear picture of how all diagrams fit together. It is a a bit magic.