Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » An Ecore file whose instances are other Ecore files(How instances of an Ecore file can become other Ecore files themselves.)
An Ecore file whose instances are other Ecore files [message #1696823] Thu, 28 May 2015 18:28 Go to next message
Hamid Qartal is currently offline Hamid QartalFriend
Messages: 33
Registered: December 2013
Member
I would like to define an Ecore, say "MMEcore.ecore", whose instances are other Ecore files, say "MEcore1.ecore", "MMEcore2.ecore". "MMEcore3.ecore", etc. In other words, when I create an instance of "MMEcore.ecore", it generates another ecore file, say "MEcore1.ecore", which in turn I can instantiate and get a regular ecore model, say "MEcore1Model.xmi".

Is this possible to do in EMF? any thoughts?

Thanks

[Updated on: Thu, 28 May 2015 18:32]

Report message to a moderator

Re: An Ecore file whose instances are other Ecore files [message #1696825 is a reply to message #1696823] Thu, 28 May 2015 19:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

Yes, and this is what you do with Ecore anyway.

However if you want to instantiate Ecore and get Ecore you need MMEcore*
to be Ecore anyway.

Regards

Ed Willink



On 28/05/2015 19:28, Hamid Qartal wrote:
> I would like to define an Ecore, say "MMEcore", whose instances are
> other Ecore files, say "MEcore1", "MMEcore2". "MMEcore3", etc. In
> other words, when I create an instance of MMEcore, it generates
> another ecore file which in turn I can instantiate and get a regular
> ecore model.
>
> Is this possible to do in EMF? any thoughts?
>
Re: An Ecore file whose instances are other Ecore files [message #1696826 is a reply to message #1696825] Thu, 28 May 2015 20:28 Go to previous messageGo to next message
Hamid Qartal is currently offline Hamid QartalFriend
Messages: 33
Registered: December 2013
Member
Thanks for the reply Ed

Then what would be the content of my MMEcore.ecore file if suppose that I want to force all of my "MMEcore1.ecore ... MMEcore3.ecore " files have a classifier named "Node" in them. How can I achieve this?

Actually I tried to define an EClass in my MMEcore.ecore file that extends EClass in ecore.ecore to achive this. But then when I instantiate MMEcore.ecore it no longer conforms to ecore.ecore, because there is no EClass named "Node" in ecore.ecore!
Which part I am missing or confusing? any thoughts?

[Updated on: Thu, 28 May 2015 20:29]

Report message to a moderator

Re: An Ecore file whose instances are other Ecore files [message #1696849 is a reply to message #1696826] Fri, 29 May 2015 04:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30553
Registered: July 2009
Senior Member
Hamid,

You can always create a reference to an EPackage or to anything else in
Ecore, e.g., in Xcore syntax:

package org.example.mmecore

import org.eclipse.emf.ecore.EPackage

class Root
{
refers EPackage ePackages
}


Then when you create a Root instance, you can generate a bunch of
EPackages (in their own resources) to which it then refers.


On 28/05/2015 10:28 PM, Hamid Qartal wrote:
> Thanks for the reply Ed
>
> Then what would be the content of my MMEcore.ecore file if suppose
> that I want to force all of my "MMEcore1.ecore ... MMEcore3.ecore "
> file have a classifier named Node in them. How can I achieve this?
>
> Actually I tried to define an EClass in my MMEcore.ecore file that
> extends EClass in ecore.ecore to achive this. But then when I
> instantiate MMEcore.ecore it no longer conforms to ecore.ecore,
> because there is no EClass named "Node" in ecore.ecore!
> Which part I am missing or confusing? any thoughts?
>
Previous Topic:Eclipse reflective API editor does not open generated xmi model file
Next Topic:[CDO] Problem opening a PApyrus model
Goto Forum:
  


Current Time: Tue Oct 22 22:00:37 GMT 2019

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

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

Back to the top