Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] Import metamodel by URI/path(Can I use simple ecore import?)
[Xcore] Import metamodel by URI/path [message #924215] Wed, 26 September 2012 16:13 Go to next message
Horacio Hoyos is currently offline Horacio Hoyos
Messages: 155
Registered: October 2009
Senior Member

Hello,

I want to use Xcore to create a meta-model that imports another meta-model. For what I understand the way to make this work is to have the meta-model I want to import in a project that has a XText nature and in which I have created a genmodel (and generated the model code?) of the meta-model. In my Xcore I then use an import clause with the package base (NS Prefix?) of the meta-model I want to import.

I work on model transformations, in which having to create a project with an XText nature and creating the genmodel for each of the meta-models is just a big amount of additional work.

Does Xcore support "simple" imports in which I can only use the meta-model's URI or path? If not, if this even possible (to post a feature request) or is there some theoretical/practical reason why Xcore does not support and will never support this?

Regards,


Horacio Hoyos Rodriguez
EngD Student
University Of York
Re: [Xcore] Import metamodel by URI/path [message #924763 is a reply to message #924215] Thu, 27 September 2012 05:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26138
Registered: July 2009
Senior Member
Horacio,

Comments below.

On 26/09/2012 6:13 PM, Horacio Hoyos wrote:
> Hello,
>
> I want to use Xcore to create a meta-model that imports another
> meta-model. For what I understand the way to make this work is to have
> the meta-model I want to import in a project that has a XText nature
> and in which I have created a genmodel (and generated the model code?)
> of the meta-model.
Yes.
> In my Xcore I then use an import clause with the package base (NS
> Prefix?) of the meta-model I want to import.
No, you use GenPackage's fully qualified name, i.e.,
<GenPackage.baseName>.<EPackage.name>.
>
> I work on model transformations, in which having to create a project
> with an XText nature and creating the genmodel for each of the
> meta-models is just a big amount of additional work.
You only have Ecore models?
>
> Does Xcore support "simple" imports in which I can only use the
> meta-model's URI or path?
No.
> If not, if this even possible (to post a feature request) or is there
> some theoretical/practical reason why Xcore does not support and will
> never support this?
No, it needs a GenModel to know how to infer a JvmModel.
>
> Regards,
Re: [Xcore] Import metamodel by URI/path [message #924970 is a reply to message #924763] Thu, 27 September 2012 09:22 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio Hoyos
Messages: 155
Registered: October 2009
Senior Member

Ed,

Thanks a lot for your answer. Yes, in my domain I usually get a bunch of models that conform to a set of meta-models in ecore "format". So I guess for the time being Xcore is not the solution for what I had in mind.

Anyhow, keep the good work because it is definitively a powerful specification.

Regards,


Horacio Hoyos Rodriguez
EngD Student
University Of York
Re: [Xcore] Import metamodel by URI/path [message #925322 is a reply to message #924763] Thu, 27 September 2012 16:02 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Ed,

I think having an ecore model without a genmodel is pretty common,
particularly as a result of transforming other model where Java code
generation isn't an issue. Wouldn't it be possible to import an ecore
model and require the extra information needed for doing the inference
and generation, potentially for both models? E.g.

import <nsUri> into <basePackage> with <extra genmodel-annotations>

You then infer one genmodel for each such import and one for the xcore
itself. I guess you'll have to infer the import's genmodel during
prelinking, so the xcore model can find the corresponding genclasses.

Hallvard

On 26.09.12 22.30, Ed Merks wrote:> Horacio,
>
> Comments below.
>
> On 26/09/2012 6:13 PM, Horacio Hoyos wrote:
>> Hello,
>>
>> I want to use Xcore to create a meta-model that imports another
>> meta-model. For what I understand the way to make this work is to have
>> the meta-model I want to import in a project that has a XText nature
>> and in which I have created a genmodel (and generated the model code?)
>> of the meta-model.
> Yes.
>> In my Xcore I then use an import clause with the package base (NS
>> Prefix?) of the meta-model I want to import.
> No, you use GenPackage's fully qualified name, i.e.,
> <GenPackage.baseName>.<EPackage.name>.
>>
>> I work on model transformations, in which having to create a project
>> with an XText nature and creating the genmodel for each of the
>> meta-models is just a big amount of additional work.
> You only have Ecore models?
>>
>> Does Xcore support "simple" imports in which I can only use the
>> meta-model's URI or path?
> No.
>> If not, if this even possible (to post a feature request) or is there
>> some theoretical/practical reason why Xcore does not support and will
>> never support this?
> No, it needs a GenModel to know how to infer a JvmModel.
>>
>> Regards,
>
Re: [Xcore] Import metamodel by URI/path [message #925403 is a reply to message #925322] Thu, 27 September 2012 17:31 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26138
Registered: July 2009
Senior Member
Hallvard,

Comments below.

On 27/09/2012 6:03 PM, Hallvard Trætteberg wrote:
> Ed,
>
> I think having an ecore model without a genmodel is pretty common,
> particularly as a result of transforming other model where Java code
> generation isn't an issue.
Yes, I imagine that's true.
> Wouldn't it be possible to import an ecore model and require the extra
> information needed for doing the inference and generation, potentially
> for both models?
It's always possible to create a GenModel on the fly with defaults...
> E.g.
>
> import <nsUri> into <basePackage> with <extra genmodel-annotations>
>
> You then infer one genmodel for each such import and one for the xcore
> itself. I guess you'll have to infer the import's genmodel during
> prelinking, so the xcore model can find the corresponding genclasses.
If someone has a serialized Ecore model, they can trivially create a
GenModel and specify things like the base package...
>
> Hallvard
>
> On 26.09.12 22.30, Ed Merks wrote:> Horacio,
> >
> > Comments below.
> >
> > On 26/09/2012 6:13 PM, Horacio Hoyos wrote:
> >> Hello,
> >>
> >> I want to use Xcore to create a meta-model that imports another
> >> meta-model. For what I understand the way to make this work is to have
> >> the meta-model I want to import in a project that has a XText nature
> >> and in which I have created a genmodel (and generated the model code?)
> >> of the meta-model.
> > Yes.
> >> In my Xcore I then use an import clause with the package base (NS
> >> Prefix?) of the meta-model I want to import.
> > No, you use GenPackage's fully qualified name, i.e.,
> > <GenPackage.baseName>.<EPackage.name>.
> >>
> >> I work on model transformations, in which having to create a project
> >> with an XText nature and creating the genmodel for each of the
> >> meta-models is just a big amount of additional work.
> > You only have Ecore models?
> >>
> >> Does Xcore support "simple" imports in which I can only use the
> >> meta-model's URI or path?
> > No.
> >> If not, if this even possible (to post a feature request) or is there
> >> some theoretical/practical reason why Xcore does not support and will
> >> never support this?
> > No, it needs a GenModel to know how to infer a JvmModel.
> >>
> >> Regards,
> >
>
Previous Topic:EMF Editor on memory model
Next Topic:[XSD] Change identifier/property mapping
Goto Forum:
  


Current Time: Fri Oct 24 12:18:51 GMT 2014

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

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