Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [xcore] Two metamodels where one refers to the other
[xcore] Two metamodels where one refers to the other [message #884591] Mon, 11 June 2012 12:31 Go to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
Hi

This is the current experiment:

* Create two metamodels with xcore [MA = Metamodel A, MB = Metamodel B].
*?? Use classes from MA in MB as types by using the XCore Datatype
mechanism. Is this the proper way to use A in B??

import metamodelA.Thing

class Something {
Thingy thingy
}

type Thingy wraps Thing

-H
Re: [xcore] Two metamodels where one refers to the other [message #884597 is a reply to message #884591] Mon, 11 June 2012 12:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hugo,

Comments below.

On 11/06/2012 2:31 PM, Hugo Garcia wrote:
> Hi
>
> This is the current experiment:
>
> * Create two metamodels with xcore [MA = Metamodel A, MB = Metamodel B].
> *?? Use classes from MA in MB as types by using the XCore Datatype
> mechanism. Is this the proper way to use A in B??
>
> import metamodelA.Thing
>
> class Something {
> Thingy thingy
> }
>
> type Thingy wraps Thing
What's Thing? A data type from the other model? You can use data types
Thing directly for attributes, i.e., Thing thingy.
>
> -H


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [xcore] Two metamodels where one refers to the other [message #884633 is a reply to message #884597] Mon, 11 June 2012 14:20 Go to previous messageGo to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
On 06/11/2012 02:49 PM, Ed Merks wrote:
> Hugo,
>
> Comments below.
>
> On 11/06/2012 2:31 PM, Hugo Garcia wrote:
>> Hi
>>
>> This is the current experiment:
>>
>> * Create two metamodels with xcore [MA = Metamodel A, MB = Metamodel B].
>> *?? Use classes from MA in MB as types by using the XCore Datatype
>> mechanism. Is this the proper way to use A in B??
>>
>> import metamodelA.Thing
>>
>> class Something {
>> Thingy thingy
>> }
>>
>> type Thingy wraps Thing
> What's Thing? A data type from the other model? You can use data types
> Thing directly for attributes, i.e., Thing thingy.
>>
>> -H

Not a datatype.

Seems that the solution is using refers like this:

in one xcore project:

--
package be.kul.thing

class Thing {
String name
--

and in the other xcore project that has a dependcy in the manifest to
the first project:

--
package be.kul.something

import be.kul.thing.Thing

class Something {
String name
refers Thing thing
}
--

right?

-H
Re: [xcore] Two metamodels where one refers to the other [message #884806 is a reply to message #884633] Mon, 11 June 2012 21:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hugo,

Yes, references need to use the keyword "refers", "contains", or
"container" and yes, you need to use plugin-in dependencies to be able
to refer to things in other Xcore resources.


On 11/06/2012 4:20 PM, Hugo Garcia wrote:
> On 06/11/2012 02:49 PM, Ed Merks wrote:
>> Hugo,
>>
>> Comments below.
>>
>> On 11/06/2012 2:31 PM, Hugo Garcia wrote:
>>> Hi
>>>
>>> This is the current experiment:
>>>
>>> * Create two metamodels with xcore [MA = Metamodel A, MB = Metamodel
>>> B].
>>> *?? Use classes from MA in MB as types by using the XCore Datatype
>>> mechanism. Is this the proper way to use A in B??
>>>
>>> import metamodelA.Thing
>>>
>>> class Something {
>>> Thingy thingy
>>> }
>>>
>>> type Thingy wraps Thing
>> What's Thing? A data type from the other model? You can use data types
>> Thing directly for attributes, i.e., Thing thingy.
>>>
>>> -H
>
> Not a datatype.
>
> Seems that the solution is using refers like this:
>
> in one xcore project:
>
> --
> package be.kul.thing
>
> class Thing {
> String name
> --
>
> and in the other xcore project that has a dependcy in the manifest to
> the first project:
>
> --
> package be.kul.something
>
> import be.kul.thing.Thing
>
> class Something {
> String name
> refers Thing thing
> }
> --
>
> right?
>
> -H
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Implementation of instance-of references
Next Topic:[Xcore] Problems using opposite
Goto Forum:
  


Current Time: Tue Apr 23 13:01:27 GMT 2024

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

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

Back to the top