Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Abstract classes and attributes
Abstract classes and attributes [message #414609] Wed, 14 November 2007 22:40 Go to next message
Eclipse UserFriend
Originally posted by: s9145896.mail.inf.tu-dresden.de

Hi all,

how can I set the attribute values of an abstract class in the implementing
classes?
For example, if I have abstract class A with attribute aType and a class B
extending A.
In B I want to say which value aType has, but in the EMF-editor I don't know
how to do this. if I create an attribute for class B then the validation
says, that there are two features with the same name. i also tried to set
derived = true, but it didn't help.

Has anybody got an idea?

Thanks,
Beata
Re: Abstract classes and attributes [message #414611 is a reply to message #414609] Wed, 14 November 2007 23:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Beata,

There's really no support for defining a different default in derived
classes. You could define EOperations with the same signature as you'd
get for a features accessors in the base class and then define the
actual features with different defaults in each derived class.


Beata wrote:
> Hi all,
>
> how can I set the attribute values of an abstract class in the
> implementing classes?
> For example, if I have abstract class A with attribute aType and a
> class B extending A.
> In B I want to say which value aType has, but in the EMF-editor I
> don't know how to do this. if I create an attribute for class B then
> the validation says, that there are two features with the same name. i
> also tried to set derived = true, but it didn't help.
>
> Has anybody got an idea?
>
> Thanks,
> Beata


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Abstract classes and attributes [message #414612 is a reply to message #414611] Thu, 15 November 2007 00:45 Go to previous message
Eclipse UserFriend
Originally posted by: s9145896.mail.inf.tu-dresden.de

Hello Ed,

thank you for your quick answer. I'll try Your suggestion.

Beata

"Ed Merks" schrieb
> Beata,
>
> There's really no support for defining a different default in derived
> classes. You could define EOperations with the same signature as you'd
> get for a features accessors in the base class and then define the
> actual features with different defaults in each derived class.
>
>
> Beata wrote:
>> Hi all,
>>
>> how can I set the attribute values of an abstract class in the
>> implementing classes?
>> For example, if I have abstract class A with attribute aType and a
>> class B extending A.
>> In B I want to say which value aType has, but in the EMF-editor I
>> don't know how to do this. if I create an attribute for class B then
>> the validation says, that there are two features with the same name. i
>> also tried to set derived = true, but it didn't help.
>>
>> Has anybody got an idea?
>>
>> Thanks,
>> Beata
Previous Topic:Cross-Document Links--Target Document Moved--Recovery
Next Topic:why cannot see emf 2.3 plugin in eclipse 3.3
Goto Forum:
  


Current Time: Tue Apr 23 09:05:55 GMT 2024

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

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

Back to the top