I have a Contract class. The contract is valid 1 Jan 2010 - 31 Dec 2010.
It can be in state Active or Passive, depending on which date I ask the instance for it's state. ex. if I ask 4 July 2010, it's in state Active, but if I ask 1 Jan 2011, it's in state Passive.
Instances are created using constructor dependency injection, i.e. they are either Active or Passive already when created, null is not allowed as a parameter for the internal state member.
One initial/created vertex is drawn in a UML state machine diagram. I have two arrows, leading out from the initial vertex, one leading to state Active and the other to state Passive.
Is this a correct representation of dependency injection in UML ?
The question specifically concerns statemachine diagrams where the first state after the initial state/vertex, is decided outside the boundaries of the diagram.
The Jude/Ashtah tool allows these kinds of constructs, i.e. drawing multiple lines from the inital vertex of the diagram, which leads me to beleive that it is correct UML graphical syntax.
This is related to http://stackoverflow.com/questions/2779922/how-model-statemachine-when-state-is-dependent-on-a-function which initiated the question on how to model DI in general, in UML.