Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-uml2.dev] About StateInvariant implementation

Hi

I think you are misreading the UML. There is no requirement that the State is 'shared' it is just a draughting convenience to re-use the State box on the diagram.

In general UML does not use sharing of anything. If you want to repeat Constraint content, you must repeat it, at least until you can invoke a re-useable Operation / query. If you're clever you might do something horrible with multiple inheritance or a stereotype.

    Regards

        Ed Willink


On 27/10/2014 16:25, Sebastien Bordes wrote:

Hi,

 

I’m currently working on Sequence Diagrams and StateMachine Diagrams.

We want to allow to reference a StateMachine’s State into a Sequence Diagram as a StateInvariant that covers a Lifeline.

 

According to the UML snippet below:

(describing relations between State, StateInvariant and Constraint)

 

http://yuml.me/03dd13b5

 

As we can see we can use the Constraint object as a link between both world (Interaction and StateMachine).

 

Unfortunately the uml2 implementation is done exactly at the inverse I would have expected.

 

The State’s stateInvariant property has a containment set to false with a cardinality of 0..1

The StateInvariant’s invariant property has a containment set to true with a cardinality of 1

 

By default the  StateInvariant will own an automatically built Constraint.

Whereas the State can have 1 or zero reference of Constraint.

 

What can I do to share a State stateInvariant on several Lifeline using several StateInvariant invariant ? IMHO the constraint should be owned by the State itself and reuse on any Lifeline by wrapping it with a StateInvariant.

 

If the containment properties are reversed, I will be able to attach a Constraint to my State and to reference it from several StateInvariant

 

Is-it a weakness into the implementation ? otherwise how can I link these items simply (without having to use free text)

(I’m using a Luna M6 derived version)

 

Thank you in advance for your help

 

 

Sébastien BORDES



_______________________________________________
mdt-uml2.dev mailing list
mdt-uml2.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-uml2.dev


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4765 / Virus Database: 4040/8461 - Release Date: 10/27/14



Back to the top