Skip to main content



      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 14:28 Go to next message
Eclipse UserFriend
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 14:32] by Moderator

Re: An Ecore file whose instances are other Ecore files [message #1696825 is a reply to message #1696823] Thu, 28 May 2015 15:26 Go to previous messageGo to next message
Eclipse UserFriend
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 16:28 Go to previous messageGo to next message
Eclipse UserFriend
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 16:29] by Moderator

Re: An Ecore file whose instances are other Ecore files [message #1696849 is a reply to message #1696826] Fri, 29 May 2015 00:39 Go to previous message
Eclipse UserFriend
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: Thu Jul 17 14:22:47 EDT 2025

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

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

Back to the top