Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] Define values for attributes inherited from defining class
[EMF] Define values for attributes inherited from defining class [message #1801225] Tue, 15 January 2019 15:46 Go to next message
Philipp Helle is currently offline Philipp HelleFriend
Messages: 1
Registered: January 2019
Junior Member
I have the following in an ecore model:

- EClass MyParameter defines a parameter by Name and Type

- EClass MyModel has a list of parameters (contained unbounded reference list)

- EClass MyModelInstance has an attribute of Type MyModel Class, showing that the MyModelInstance is typed by a MyModel Class
I would like to fill out concrete values of the parameters at this level.

E.g.:
MyParameter:
name: Color
type: (enum: blue, red)

MyModel:Car
Attribute: name color; Type Color

MyModelInstance:RedCar
Attribute: name color ->value: red

MyModelInstance:BlueCar
Attribute: name color ->value: blue

How do I manage that all parameters defined on the model level appear at the instance level and that I can set the values there?
Re: [EMF] Define values for attributes inherited from defining class [message #1801320 is a reply to message #1801225] Wed, 16 January 2019 17:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

"Parameter" is normally used for the argument of a Function/Operation. I presume you mean Feature/Property. Ecore supports default values for EStructuralFeatures; just look in the Properties View.

Regards

Ed Willink

Re: [EMF] Define values for attributes inherited from defining class [message #1801346 is a reply to message #1801225] Thu, 17 January 2019 09:45 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Philipp Helle wrote on Tue, 15 January 2019 16:46

How do I manage that all parameters defined on the model level appear at the instance level and that I can set the values there?


What does "apear" mean in your context? Are you developing an editor where you edit your model and its instances?

It seems you are creating a meta-meta-model. Ecore already supports dynamic models that you could use.
Previous Topic:[CDO] Best way to manage Detached object/Stale References
Next Topic:[EMF] XMI loading option XMLResource.OPTION_DEFER_IDREF_RESOLUTION and "non unique" ERefer
Goto Forum:
  


Current Time: Fri Apr 19 22:22:01 GMT 2024

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

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

Back to the top