Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Problems redefining an inherited operation
Problems redefining an inherited operation [message #478225] Sun, 08 March 2009 17:34 Go to next message
Theresa Linke is currently offline Theresa LinkeFriend
Messages: 4
Registered: July 2009
Junior Member
I have problems redefining an inherited operation.

I'm working on an UML2 profile for my project in MDSD.

Stereotype MediaComponent is an abstract classifier. The subclass
stereotype MediaContainer is associated via generalization. Both are
extensions of (ecore) EClass. I redefine an operation addMedia(Media) in
stereotype MediaContainer which is inherited from from stereotype
MediaComponent by setting the property "Redefined Operation" to point to
the general operation. Method name and parameters are set to the same
values as in the general operation, only the included code shall be
redefined in the generated code.
When I try to define the profile I get to one error and one warning for
each operation I try to redefine.

The error is:
Operation addMedia is a duplicate of inherited operation addMedia()

The warning is:
Operation addMedia sould be annotated as redefinition of operation
addMedia()

When I remove the operation from the subclass everything works fine. When
I remove the property "Redefined Operation" I only get the error
concerning the duplicate operation.

I tried various ways to solve the problem but didn't find any solutions.

Any ideas?
Re: Problems redefining an inherited operation [message #478232 is a reply to message #478225] Mon, 09 March 2009 14:37 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Theresa,

The only way to support redefinition (and other UML-specific constructs like
subsetting and unions) in a profile is to define the profile statically.
Dynamic profile definitions make use of the default Ecore mapping, and Ecore
does not support redefinition. With static definitions, you generate code
for the profile just as with any other metamodel, and have complete control
over the generator settings and implementation.

Kenn

"Theresa Linke" <Theresa.linke@cybercon.de> wrote in message
news:c87805959f97aafebcff5da74f98ab22$1@www.eclipse.org...
>I have problems redefining an inherited operation.
>
> I'm working on an UML2 profile for my project in MDSD.
>
> Stereotype MediaComponent is an abstract classifier. The subclass
> stereotype MediaContainer is associated via generalization. Both are
> extensions of (ecore) EClass. I redefine an operation addMedia(Media) in
> stereotype MediaContainer which is inherited from from stereotype
> MediaComponent by setting the property "Redefined Operation" to point to
> the general operation. Method name and parameters are set to the same
> values as in the general operation, only the included code shall be
> redefined in the generated code.
> When I try to define the profile I get to one error and one warning for
> each operation I try to redefine.
>
> The error is:
> Operation addMedia is a duplicate of inherited operation addMedia()
>
> The warning is:
> Operation addMedia sould be annotated as redefinition of operation
> addMedia()
>
> When I remove the operation from the subclass everything works fine. When
> I remove the property "Redefined Operation" I only get the error
> concerning the duplicate operation.
>
> I tried various ways to solve the problem but didn't find any solutions.
>
> Any ideas?
>
Re: Problems redefining an inherited operation [message #478242 is a reply to message #478232] Sat, 14 March 2009 16:36 Go to previous messageGo to next message
Theresa Linke is currently offline Theresa LinkeFriend
Messages: 4
Registered: July 2009
Junior Member
Thanks for you help Kenn.
I changed my profile using the following little tutorial
( http://dev.eclipse.org/newslists/news.eclipse.modeling.mdt.u ml2/msg00817.html).
It worked fine so far, but when I try to create the EMF model and load my
Profile I still get an error (or more a warning) for each operation I
tried to redefine (Operation x should be annotated as redefinition of y)
and additionaly several warnings for uml redefinitions. I can proceed
because I selected "process all" and the genmodel is created but not the
redefinied operations which are all missing.
What could be the problem?
Re: Problems redefining an inherited operation [message #478245 is a reply to message #478242] Mon, 16 March 2009 22:08 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Theresa,

You need to select the option to process redefinitions (in the EMF
project/model wizard) rather than reporting them...

Kenn

"Theresa Linke" <Theresa.linke@cybercon.de> wrote in message
news:d8a674e5e469f1184e62db187cb84e8f$1@www.eclipse.org...
> Thanks for you help Kenn. I changed my profile using the following little
> tutorial
> ( http://dev.eclipse.org/newslists/news.eclipse.modeling.mdt.u ml2/msg00817.html).
> It worked fine so far, but when I try to create the EMF model and load my
> Profile I still get an error (or more a warning) for each operation I
> tried to redefine (Operation x should be annotated as redefinition of y)
> and additionaly several warnings for uml redefinitions. I can proceed
> because I selected "process all" and the genmodel is created but not the
> redefinied operations which are all missing.
> What could be the problem?
Re: Problems redefining an inherited operation [message #627428 is a reply to message #478225] Mon, 09 March 2009 14:37 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Theresa,

The only way to support redefinition (and other UML-specific constructs like
subsetting and unions) in a profile is to define the profile statically.
Dynamic profile definitions make use of the default Ecore mapping, and Ecore
does not support redefinition. With static definitions, you generate code
for the profile just as with any other metamodel, and have complete control
over the generator settings and implementation.

Kenn

"Theresa Linke" <Theresa.linke@cybercon.de> wrote in message
news:c87805959f97aafebcff5da74f98ab22$1@www.eclipse.org...
>I have problems redefining an inherited operation.
>
> I'm working on an UML2 profile for my project in MDSD.
>
> Stereotype MediaComponent is an abstract classifier. The subclass
> stereotype MediaContainer is associated via generalization. Both are
> extensions of (ecore) EClass. I redefine an operation addMedia(Media) in
> stereotype MediaContainer which is inherited from from stereotype
> MediaComponent by setting the property "Redefined Operation" to point to
> the general operation. Method name and parameters are set to the same
> values as in the general operation, only the included code shall be
> redefined in the generated code.
> When I try to define the profile I get to one error and one warning for
> each operation I try to redefine.
>
> The error is:
> Operation addMedia is a duplicate of inherited operation addMedia()
>
> The warning is:
> Operation addMedia sould be annotated as redefinition of operation
> addMedia()
>
> When I remove the operation from the subclass everything works fine. When
> I remove the property "Redefined Operation" I only get the error
> concerning the duplicate operation.
>
> I tried various ways to solve the problem but didn't find any solutions.
>
> Any ideas?
>
Re: Problems redefining an inherited operation [message #627436 is a reply to message #478232] Sat, 14 March 2009 16:36 Go to previous message
Theresa Linke is currently offline Theresa LinkeFriend
Messages: 4
Registered: July 2009
Junior Member
Thanks for you help Kenn.
I changed my profile using the following little tutorial
( http://dev.eclipse.org/newslists/news.eclipse.modeling.mdt.u ml2/msg00817.html).
It worked fine so far, but when I try to create the EMF model and load my
Profile I still get an error (or more a warning) for each operation I
tried to redefine (Operation x should be annotated as redefinition of y)
and additionaly several warnings for uml redefinitions. I can proceed
because I selected "process all" and the genmodel is created but not the
redefinied operations which are all missing.
What could be the problem?
Re: Problems redefining an inherited operation [message #627439 is a reply to message #478242] Mon, 16 March 2009 22:08 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Theresa,

You need to select the option to process redefinitions (in the EMF
project/model wizard) rather than reporting them...

Kenn

"Theresa Linke" <Theresa.linke@cybercon.de> wrote in message
news:d8a674e5e469f1184e62db187cb84e8f$1@www.eclipse.org...
> Thanks for you help Kenn. I changed my profile using the following little
> tutorial
> ( http://dev.eclipse.org/newslists/news.eclipse.modeling.mdt.u ml2/msg00817.html).
> It worked fine so far, but when I try to create the EMF model and load my
> Profile I still get an error (or more a warning) for each operation I
> tried to redefine (Operation x should be annotated as redefinition of y)
> and additionaly several warnings for uml redefinitions. I can proceed
> because I selected "process all" and the genmodel is created but not the
> redefinied operations which are all missing.
> What could be the problem?
Previous Topic:Behavior Execution Specification overlapping
Next Topic:[Announce] MDT UML2 3.0.0M6 is available
Goto Forum:
  


Current Time: Thu Mar 28 07:56:23 GMT 2024

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

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

Back to the top