Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Missing operations of realized interfaces in StateMachine Diagram
Missing operations of realized interfaces in StateMachine Diagram [message #469782] Thu, 26 March 2009 09:45 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey all,

i've created an interface, which is realized by a component. In the
context of this component, i've defined a state machine, just with a few
states and transitions. Now, i want to create a CallEvent as the
transitions trigger, which points to a operation, provided by the
realized interface. That is not possible! Only directly contained
operations can be selected.

Is there a work around because it seems to me very cumbersome, to
recreate each operation, which is already defined in the interface.

Thx
Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469788 is a reply to message #469782] Thu, 26 March 2009 19:08 Go to previous messageGo to next message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
In fact, we assumed that an Interface operation should have an
implementation in the realizing Class for operations defined in the
interfaces.

This is slightly different with Class inheritance, as the operation can
be defined and implemented in the father class without necessary being
overrided in children. In this case you can refers Class owned
operations and inherited operations.

As a workaround you may want to use a Generalization between the Class
and Interface (instead of Realization).

Alternately, you could implement a small Popup action the copies
operations from realized Interfaces into current Class.

regards,

Yann Tanguy


Timothy Marc a écrit :
> Hey all,
>
> i've created an interface, which is realized by a component. In the
> context of this component, i've defined a state machine, just with a few
> states and transitions. Now, i want to create a CallEvent as the
> transitions trigger, which points to a operation, provided by the
> realized interface. That is not possible! Only directly contained
> operations can be selected.
>
> Is there a work around because it seems to me very cumbersome, to
> recreate each operation, which is already defined in the interface.
>
> Thx
> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469790 is a reply to message #469788] Fri, 27 March 2009 01:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Yann,

Unfortunately, UML does not permit Classes to have Generalization
relationships to Interfaces. Generalizations are only well-formed from
a specializing classifier to a general classifier of the same metaclass
or a more general metaclass. Thus, for example, an AssociationClass may
specialize an Association or a Class, but a Class or Association may not
specialize an AssociationClass or an Interface.

Cheers,

Christian


Yann Tanguy wrote:
>
> As a workaround you may want to use a Generalization between the Class
> and Interface (instead of Realization).
>

-----8<-----
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469792 is a reply to message #469788] Fri, 27 March 2009 09:15 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
So, if this behavior is not a bug, but a feature. But due to the fact,
that the UML Superstructure doesn't allow a Generalization between Class
und Interface, it would be nice, if the Operations provided by
InterfaceRealization are shown within the Dialog in a seperate Tree,
that shows only these kind of Operations.

I think this might be a good alternative in contrast to those hacky
workarounds, isn't it?

Timothy

Yann Tanguy schrieb:
> In fact, we assumed that an Interface operation should have an
> implementation in the realizing Class for operations defined in the
> interfaces.
>
> This is slightly different with Class inheritance, as the operation can
> be defined and implemented in the father class without necessary being
> overrided in children. In this case you can refers Class owned
> operations and inherited operations.
>
> As a workaround you may want to use a Generalization between the Class
> and Interface (instead of Realization).
>
> Alternately, you could implement a small Popup action the copies
> operations from realized Interfaces into current Class.
>
> regards,
>
> Yann Tanguy
>
>
> Timothy Marc a écrit :
>> Hey all,
>>
>> i've created an interface, which is realized by a component. In the
>> context of this component, i've defined a state machine, just with a
>> few states and transitions. Now, i want to create a CallEvent as the
>> transitions trigger, which points to a operation, provided by the
>> realized interface. That is not possible! Only directly contained
>> operations can be selected.
>>
>> Is there a work around because it seems to me very cumbersome, to
>> recreate each operation, which is already defined in the interface.
>>
>> Thx
>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469794 is a reply to message #469790] Fri, 27 March 2009 09:55 Go to previous messageGo to next message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
Hi Christian,

You are probably right but I could not figure out the constraint you
mention in the UML2 spec.
Structurally, Interface inherits from Classifier and Generalization
links Classifiers. I did not see constraint related to Generalization in
the specification except this one:

[1] Every Generalization associated with a given GeneralizationSet must
have the same general Classifier. That is, all
Generalizations for a particular GeneralizationSet must have the same
superclass.

Best regards,

Yann


Christian W. Damus a écrit :
> Hi, Yann,
>
> Unfortunately, UML does not permit Classes to have Generalization
> relationships to Interfaces. Generalizations are only well-formed from
> a specializing classifier to a general classifier of the same metaclass
> or a more general metaclass. Thus, for example, an AssociationClass may
> specialize an Association or a Class, but a Class or Association may not
> specialize an AssociationClass or an Interface.
>
> Cheers,
>
> Christian
>
>
> Yann Tanguy wrote:
>>
>> As a workaround you may want to use a Generalization between the Class
>> and Interface (instead of Realization).
>>
>
> -----8<-----
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469796 is a reply to message #469792] Fri, 27 March 2009 13:46 Go to previous messageGo to next message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
Hi Timothy,

Sorry for the confusion, my mistake:
- yes this should be possible (atually it is, I just fixed this in the
source code)

The workaround I proposed were "ready-to-use-alternate" solutions to
resume your modeling work without waiting for the fix.

regards,

Yann

Timothy Marc a écrit :
> So, if this behavior is not a bug, but a feature. But due to the fact,
> that the UML Superstructure doesn't allow a Generalization between Class
> und Interface, it would be nice, if the Operations provided by
> InterfaceRealization are shown within the Dialog in a seperate Tree,
> that shows only these kind of Operations.
>
> I think this might be a good alternative in contrast to those hacky
> workarounds, isn't it?
>
> Timothy
>
> Yann Tanguy schrieb:
>> In fact, we assumed that an Interface operation should have an
>> implementation in the realizing Class for operations defined in the
>> interfaces.
>>
>> This is slightly different with Class inheritance, as the operation
>> can be defined and implemented in the father class without necessary
>> being overrided in children. In this case you can refers Class owned
>> operations and inherited operations.
>>
>> As a workaround you may want to use a Generalization between the Class
>> and Interface (instead of Realization).
>>
>> Alternately, you could implement a small Popup action the copies
>> operations from realized Interfaces into current Class.
>>
>> regards,
>>
>> Yann Tanguy
>>
>>
>> Timothy Marc a écrit :
>>> Hey all,
>>>
>>> i've created an interface, which is realized by a component. In the
>>> context of this component, i've defined a state machine, just with a
>>> few states and transitions. Now, i want to create a CallEvent as the
>>> transitions trigger, which points to a operation, provided by the
>>> realized interface. That is not possible! Only directly contained
>>> operations can be selected.
>>>
>>> Is there a work around because it seems to me very cumbersome, to
>>> recreate each operation, which is already defined in the interface.
>>>
>>> Thx
>>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469799 is a reply to message #469796] Fri, 27 March 2009 16:02 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Well, i'm looking forward to test it :-)

Thx Timothy

Yann Tanguy schrieb:
> Hi Timothy,
>
> Sorry for the confusion, my mistake:
> - yes this should be possible (atually it is, I just fixed this in the
> source code)
>
> The workaround I proposed were "ready-to-use-alternate" solutions to
> resume your modeling work without waiting for the fix.
>
> regards,
>
> Yann
>
> Timothy Marc a écrit :
>> So, if this behavior is not a bug, but a feature. But due to the fact,
>> that the UML Superstructure doesn't allow a Generalization between
>> Class und Interface, it would be nice, if the Operations provided by
>> InterfaceRealization are shown within the Dialog in a seperate Tree,
>> that shows only these kind of Operations.
>>
>> I think this might be a good alternative in contrast to those hacky
>> workarounds, isn't it?
>>
>> Timothy
>>
>> Yann Tanguy schrieb:
>>> In fact, we assumed that an Interface operation should have an
>>> implementation in the realizing Class for operations defined in the
>>> interfaces.
>>>
>>> This is slightly different with Class inheritance, as the operation
>>> can be defined and implemented in the father class without necessary
>>> being overrided in children. In this case you can refers Class owned
>>> operations and inherited operations.
>>>
>>> As a workaround you may want to use a Generalization between the
>>> Class and Interface (instead of Realization).
>>>
>>> Alternately, you could implement a small Popup action the copies
>>> operations from realized Interfaces into current Class.
>>>
>>> regards,
>>>
>>> Yann Tanguy
>>>
>>>
>>> Timothy Marc a écrit :
>>>> Hey all,
>>>>
>>>> i've created an interface, which is realized by a component. In the
>>>> context of this component, i've defined a state machine, just with a
>>>> few states and transitions. Now, i want to create a CallEvent as
>>>> the transitions trigger, which points to a operation, provided by
>>>> the realized interface. That is not possible! Only directly
>>>> contained operations can be selected.
>>>>
>>>> Is there a work around because it seems to me very cumbersome, to
>>>> recreate each operation, which is already defined in the interface.
>>>>
>>>> Thx
>>>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #469832 is a reply to message #469794] Sat, 28 March 2009 15:40 Go to previous message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Yann,

It isn't actually a Generalization constraint, but a Classifier constraint:

"""
[3] A classifier may only specialize classifiers of a valid type.
self.parents()->forAll(c | self.maySpecializeType(c))
"""


Classifier::maySpecializeType(Classifier) is defined thus:

"""
[8] The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of
the specified type. By default a classifier may specialize classifiers
of the same or a more general type. It is intended to be
redefined by classifiers that have different specialization constraints.
Classifier::maySpecializeType(c : Classifier) : Boolean;
maySpecializeType = self.oclIsKindOf(c.oclType)
"""

It uses the non-existent oclType attribute which, in OCL 2.1, will be
re-introduced as an oclType() query. It obtains an element's metaclass.

As it happens, maySpecializeType() is nowhere redefined, so this
constraint holds for all classifiers.

Cheers,

Christian


Yann Tanguy wrote:
> Hi Christian,
>
> You are probably right but I could not figure out the constraint you
> mention in the UML2 spec.
> Structurally, Interface inherits from Classifier and Generalization
> links Classifiers. I did not see constraint related to Generalization in
> the specification except this one:
>
> [1] Every Generalization associated with a given GeneralizationSet must
> have the same general Classifier. That is, all
> Generalizations for a particular GeneralizationSet must have the same
> superclass.
>
> Best regards,
>
> Yann
>

-----8<-----
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582267 is a reply to message #469782] Thu, 26 March 2009 19:08 Go to previous message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
In fact, we assumed that an Interface operation should have an
implementation in the realizing Class for operations defined in the
interfaces.

This is slightly different with Class inheritance, as the operation can
be defined and implemented in the father class without necessary being
overrided in children. In this case you can refers Class owned
operations and inherited operations.

As a workaround you may want to use a Generalization between the Class
and Interface (instead of Realization).

Alternately, you could implement a small Popup action the copies
operations from realized Interfaces into current Class.

regards,

Yann Tanguy


Timothy Marc a écrit :
> Hey all,
>
> i've created an interface, which is realized by a component. In the
> context of this component, i've defined a state machine, just with a few
> states and transitions. Now, i want to create a CallEvent as the
> transitions trigger, which points to a operation, provided by the
> realized interface. That is not possible! Only directly contained
> operations can be selected.
>
> Is there a work around because it seems to me very cumbersome, to
> recreate each operation, which is already defined in the interface.
>
> Thx
> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582285 is a reply to message #469788] Fri, 27 March 2009 01:54 Go to previous message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Yann,

Unfortunately, UML does not permit Classes to have Generalization
relationships to Interfaces. Generalizations are only well-formed from
a specializing classifier to a general classifier of the same metaclass
or a more general metaclass. Thus, for example, an AssociationClass may
specialize an Association or a Class, but a Class or Association may not
specialize an AssociationClass or an Interface.

Cheers,

Christian


Yann Tanguy wrote:
>
> As a workaround you may want to use a Generalization between the Class
> and Interface (instead of Realization).
>

-----8<-----
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582300 is a reply to message #469788] Fri, 27 March 2009 09:15 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
So, if this behavior is not a bug, but a feature. But due to the fact,
that the UML Superstructure doesn't allow a Generalization between Class
und Interface, it would be nice, if the Operations provided by
InterfaceRealization are shown within the Dialog in a seperate Tree,
that shows only these kind of Operations.

I think this might be a good alternative in contrast to those hacky
workarounds, isn't it?

Timothy

Yann Tanguy schrieb:
> In fact, we assumed that an Interface operation should have an
> implementation in the realizing Class for operations defined in the
> interfaces.
>
> This is slightly different with Class inheritance, as the operation can
> be defined and implemented in the father class without necessary being
> overrided in children. In this case you can refers Class owned
> operations and inherited operations.
>
> As a workaround you may want to use a Generalization between the Class
> and Interface (instead of Realization).
>
> Alternately, you could implement a small Popup action the copies
> operations from realized Interfaces into current Class.
>
> regards,
>
> Yann Tanguy
>
>
> Timothy Marc a écrit :
>> Hey all,
>>
>> i've created an interface, which is realized by a component. In the
>> context of this component, i've defined a state machine, just with a
>> few states and transitions. Now, i want to create a CallEvent as the
>> transitions trigger, which points to a operation, provided by the
>> realized interface. That is not possible! Only directly contained
>> operations can be selected.
>>
>> Is there a work around because it seems to me very cumbersome, to
>> recreate each operation, which is already defined in the interface.
>>
>> Thx
>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582308 is a reply to message #469790] Fri, 27 March 2009 09:55 Go to previous message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
Hi Christian,

You are probably right but I could not figure out the constraint you
mention in the UML2 spec.
Structurally, Interface inherits from Classifier and Generalization
links Classifiers. I did not see constraint related to Generalization in
the specification except this one:

[1] Every Generalization associated with a given GeneralizationSet must
have the same general Classifier. That is, all
Generalizations for a particular GeneralizationSet must have the same
superclass.

Best regards,

Yann


Christian W. Damus a écrit :
> Hi, Yann,
>
> Unfortunately, UML does not permit Classes to have Generalization
> relationships to Interfaces. Generalizations are only well-formed from
> a specializing classifier to a general classifier of the same metaclass
> or a more general metaclass. Thus, for example, an AssociationClass may
> specialize an Association or a Class, but a Class or Association may not
> specialize an AssociationClass or an Interface.
>
> Cheers,
>
> Christian
>
>
> Yann Tanguy wrote:
>>
>> As a workaround you may want to use a Generalization between the Class
>> and Interface (instead of Realization).
>>
>
> -----8<-----
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582322 is a reply to message #469792] Fri, 27 March 2009 13:46 Go to previous message
Yann Tanguy is currently offline Yann TanguyFriend
Messages: 80
Registered: July 2009
Member
Hi Timothy,

Sorry for the confusion, my mistake:
- yes this should be possible (atually it is, I just fixed this in the
source code)

The workaround I proposed were "ready-to-use-alternate" solutions to
resume your modeling work without waiting for the fix.

regards,

Yann

Timothy Marc a écrit :
> So, if this behavior is not a bug, but a feature. But due to the fact,
> that the UML Superstructure doesn't allow a Generalization between Class
> und Interface, it would be nice, if the Operations provided by
> InterfaceRealization are shown within the Dialog in a seperate Tree,
> that shows only these kind of Operations.
>
> I think this might be a good alternative in contrast to those hacky
> workarounds, isn't it?
>
> Timothy
>
> Yann Tanguy schrieb:
>> In fact, we assumed that an Interface operation should have an
>> implementation in the realizing Class for operations defined in the
>> interfaces.
>>
>> This is slightly different with Class inheritance, as the operation
>> can be defined and implemented in the father class without necessary
>> being overrided in children. In this case you can refers Class owned
>> operations and inherited operations.
>>
>> As a workaround you may want to use a Generalization between the Class
>> and Interface (instead of Realization).
>>
>> Alternately, you could implement a small Popup action the copies
>> operations from realized Interfaces into current Class.
>>
>> regards,
>>
>> Yann Tanguy
>>
>>
>> Timothy Marc a écrit :
>>> Hey all,
>>>
>>> i've created an interface, which is realized by a component. In the
>>> context of this component, i've defined a state machine, just with a
>>> few states and transitions. Now, i want to create a CallEvent as the
>>> transitions trigger, which points to a operation, provided by the
>>> realized interface. That is not possible! Only directly contained
>>> operations can be selected.
>>>
>>> Is there a work around because it seems to me very cumbersome, to
>>> recreate each operation, which is already defined in the interface.
>>>
>>> Thx
>>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #582341 is a reply to message #469796] Fri, 27 March 2009 16:02 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Well, i'm looking forward to test it :-)

Thx Timothy

Yann Tanguy schrieb:
> Hi Timothy,
>
> Sorry for the confusion, my mistake:
> - yes this should be possible (atually it is, I just fixed this in the
> source code)
>
> The workaround I proposed were "ready-to-use-alternate" solutions to
> resume your modeling work without waiting for the fix.
>
> regards,
>
> Yann
>
> Timothy Marc a écrit :
>> So, if this behavior is not a bug, but a feature. But due to the fact,
>> that the UML Superstructure doesn't allow a Generalization between
>> Class und Interface, it would be nice, if the Operations provided by
>> InterfaceRealization are shown within the Dialog in a seperate Tree,
>> that shows only these kind of Operations.
>>
>> I think this might be a good alternative in contrast to those hacky
>> workarounds, isn't it?
>>
>> Timothy
>>
>> Yann Tanguy schrieb:
>>> In fact, we assumed that an Interface operation should have an
>>> implementation in the realizing Class for operations defined in the
>>> interfaces.
>>>
>>> This is slightly different with Class inheritance, as the operation
>>> can be defined and implemented in the father class without necessary
>>> being overrided in children. In this case you can refers Class owned
>>> operations and inherited operations.
>>>
>>> As a workaround you may want to use a Generalization between the
>>> Class and Interface (instead of Realization).
>>>
>>> Alternately, you could implement a small Popup action the copies
>>> operations from realized Interfaces into current Class.
>>>
>>> regards,
>>>
>>> Yann Tanguy
>>>
>>>
>>> Timothy Marc a écrit :
>>>> Hey all,
>>>>
>>>> i've created an interface, which is realized by a component. In the
>>>> context of this component, i've defined a state machine, just with a
>>>> few states and transitions. Now, i want to create a CallEvent as
>>>> the transitions trigger, which points to a operation, provided by
>>>> the realized interface. That is not possible! Only directly
>>>> contained operations can be selected.
>>>>
>>>> Is there a work around because it seems to me very cumbersome, to
>>>> recreate each operation, which is already defined in the interface.
>>>>
>>>> Thx
>>>> Timothy
Re: Missing operations of realized interfaces in StateMachine Diagram [message #584485 is a reply to message #469794] Sat, 28 March 2009 15:40 Go to previous message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

Hi, Yann,

It isn't actually a Generalization constraint, but a Classifier constraint:

"""
[3] A classifier may only specialize classifiers of a valid type.
self.parents()->forAll(c | self.maySpecializeType(c))
"""


Classifier::maySpecializeType(Classifier) is defined thus:

"""
[8] The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of
the specified type. By default a classifier may specialize classifiers
of the same or a more general type. It is intended to be
redefined by classifiers that have different specialization constraints.
Classifier::maySpecializeType(c : Classifier) : Boolean;
maySpecializeType = self.oclIsKindOf(c.oclType)
"""

It uses the non-existent oclType attribute which, in OCL 2.1, will be
re-introduced as an oclType() query. It obtains an element's metaclass.

As it happens, maySpecializeType() is nowhere redefined, so this
constraint holds for all classifiers.

Cheers,

Christian


Yann Tanguy wrote:
> Hi Christian,
>
> You are probably right but I could not figure out the constraint you
> mention in the UML2 spec.
> Structurally, Interface inherits from Classifier and Generalization
> links Classifiers. I did not see constraint related to Generalization in
> the specification except this one:
>
> [1] Every Generalization associated with a given GeneralizationSet must
> have the same general Classifier. That is, all
> Generalizations for a particular GeneralizationSet must have the same
> superclass.
>
> Best regards,
>
> Yann
>

-----8<-----
Previous Topic:Static profiles from 3rd party for Papyrus
Next Topic:Buildin PapyrusUML from souce
Goto Forum:
  


Current Time: Fri Mar 29 01:43:08 GMT 2024

Powered by FUDForum. Page generated in 0.09606 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top