Skip to main content



      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 12:13 Go to next message
Eclipse UserFriend
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,
Re: [Xcore] Import metamodel by URI/path [message #924763 is a reply to message #924215] Thu, 27 September 2012 01:30 Go to previous messageGo to next message
Eclipse UserFriend
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 05:22 Go to previous messageGo to next message
Eclipse UserFriend
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,
Re: [Xcore] Import metamodel by URI/path [message #925322 is a reply to message #924763] Thu, 27 September 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 13:31 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 08:54:35 EDT 2025

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

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

Back to the top