Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Redefining attribute
Redefining attribute [message #429578] Sat, 25 April 2009 14:13 Go to next message
weevee is currently offline weeveeFriend
Messages: 5
Registered: July 2009
Junior Member
Hello,

I have a superclass A (with 4 attributes with EType: EInt)
A has some subclasses B,C,..
B also has subclasses D,E
In class D I want to give my attribute another default value.
=> I make new attribute with the same name => redefine the attribute (like
Java)

But this doesn't work...
Problem: There may not be two features named 'attribute1'

Could somebody give a solution

Thanks a lot
Grtz
Re: Redefining attribute [message #429581 is a reply to message #429578] Sat, 25 April 2009 14:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Grtz,

There's simply no support for this. The default is fixed at the point
where the feature is defined and you can't redefine a feature in a
derived class.


weevee wrote:
> Hello,
>
> I have a superclass A (with 4 attributes with EType: EInt)
> A has some subclasses B,C,..
> B also has subclasses D,E
> In class D I want to give my attribute another default value.
> => I make new attribute with the same name => redefine the attribute
> (like Java)
>
> But this doesn't work...
> Problem: There may not be two features named 'attribute1'
>
> Could somebody give a solution
>
> Thanks a lot
> Grtz
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Redefining attribute [message #429589 is a reply to message #429581] Sun, 26 April 2009 20:23 Go to previous messageGo to next message
weevee is currently offline weeveeFriend
Messages: 5
Registered: July 2009
Junior Member
Hello,

Thanks for your very quick answer!
Is there a reason why it's not implemented? Or can you give a link where I
can find some information.

Thanks
Grtz
Re: Redefining attribute [message #429590 is a reply to message #429589] Sun, 26 April 2009 22:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Grtz,

A feature is like a field and even in Java if you define a field with
the same name in a derived class it's a different field than the one in
the base class, not a redefinition of the base classes field.
Redefinition is simply not something Java supports nor something that
Ecore/EMOF supports.


weevee wrote:
> Hello,
>
> Thanks for your very quick answer!
> Is there a reason why it's not implemented? Or can you give a link
> where I can find some information.
>
> Thanks
> Grtz
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Modify Property + Save Buttons
Next Topic:[Teneo] Incorrect hbm generated or is it me?
Goto Forum:
  


Current Time: Fri Apr 26 05:36:08 GMT 2024

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

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

Back to the top