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  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #925322 is a reply to message #924763] |
Thu, 27 September 2012 12:02   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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,
> >
>
|
|
|
Goto Forum:
Current Time: Sat Jul 05 08:54:35 EDT 2025
Powered by FUDForum. Page generated in 0.28064 seconds
|