Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » One EClass for Two Ecore models
One EClass for Two Ecore models [message #1516091] Thu, 18 December 2014 16:52 Go to next message
Vinicius Pereira is currently offline Vinicius PereiraFriend
Messages: 50
Registered: March 2014
Member
Hi everyone,

I have two ecore models (M1 and M2) and I want to have the same EClass in both models.

M1 and M2 are in the same project and folder. In M1 I have an EClass called Mapping. The same EClass exists in M2.

Is there a way of "link" Mapping in both models? I need that Eclipse understand that it is the same class. Because when I generate code from M2 after M1 it always overwrite the previous.


thanks
Re: One EClass for Two Ecore models [message #1516118 is a reply to message #1516091] Thu, 18 December 2014 17:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
Vinicius,

Comments below.


On 18/12/2014 5:52 PM, Vinicius Pereira wrote:
> Hi everyone,
>
> I have two ecore models (M1 and M2) and I want to have the same EClass
> in both models.
That's contradictory.
>
> M1 and M2 are in the same project and folder. In M1 I have an EClass
> called Mapping. The same EClass exists in M2.
The fact it's in a different model means its a different class. There's
nothing else to say.
>
> Is there a way of "link" Mapping in both models?
No.
> I need that Eclipse understand that it is the same class.
It's not so nothing will understand that.
> Because when I generate code from M2 after M1 it always overwrite the
> previous.
It should be defined in one of the models and the other should reuse
it. There are no alternatives
>
>
> thanks
Re: One EClass for Two Ecore models [message #1516221 is a reply to message #1516118] Thu, 18 December 2014 18:50 Go to previous messageGo to next message
Vinicius Pereira is currently offline Vinicius PereiraFriend
Messages: 50
Registered: March 2014
Member
Hmmm... I did in separated models because in thought it was better to understand and have images.

For example, in a model I show how to map a formal element to an UML element using a mapping.
In the other model, I show how to create the mapping that I use above.

In my opinion, two models was better... So I just put everything in one model?
Re: One EClass for Two Ecore models [message #1517020 is a reply to message #1516221] Fri, 19 December 2014 07:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
Vinicius,

Comments below.

On 18/12/2014 7:50 PM, Vinicius Pereira wrote:
> Hmmm... I did in separated models because in thought it was better to
> understand and have images.
There's nothing wrong with having multiple models, it's just misguided
to "I want the same thing to be in both models".
>
> For example, in a model I show how to map a formal element to an UML
> element using a mapping.
Now sure what you mean by "showing"? Are we really talking about Ecore
models? In Ecore models you define structure, you don't just "show" things.
> In the other model, I show how to create the mapping that I use above.
I don't get this "show how to create" terminology.
>
> In my opinion, two models was better... So I just put everything in
> one model?
That's not what I said. A concept should be defined once and if you
want to reuse it, you should reuse it, not define it a second time and
then "link" it.
Re: One EClass for Two Ecore models [message #1517381 is a reply to message #1517020] Fri, 19 December 2014 13:07 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Maybe you just don't know how to reuse one from the other?

You open the context menu in the editor of one, and select "Load
Resource...". Here you select the other one. And whoops, you can use the
elements from that one in your model.
Re: One EClass for Two Ecore models [message #1522224 is a reply to message #1516221] Mon, 22 December 2014 07:17 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hi,

Am 18.12.2014 um 19:50 schrieb Vinicius Pereira:
> For example, in a model I show how to map a formal element to an UML
> element using a mapping.
> In the other model, I show how to create the mapping that I use above.
>
> In my opinion, two models was better... So I just put everything in one
> model?
what you really want is one ecore model but several different kinds of
representation of this model. I assume you want to present different
views on the same model. You can definitely do that (e.g. with several
Ecore Diagrams) but the model is the only one, as Ed already said.

cheers,
Jan
Re: One EClass for Two Ecore models [message #1524847 is a reply to message #1522224] Tue, 23 December 2014 18:04 Go to previous message
Vinicius Pereira is currently offline Vinicius PereiraFriend
Messages: 50
Registered: March 2014
Member
Jan Reimann wrote on Mon, 22 December 2014 02:17
Hi,

Am 18.12.2014 um 19:50 schrieb Vinicius Pereira:
> For example, in a model I show how to map a formal element to an UML
> element using a mapping.
> In the other model, I show how to create the mapping that I use above.
>
> In my opinion, two models was better... So I just put everything in one
> model?
what you really want is one ecore model but several different kinds of
representation of this model. I assume you want to present different
views on the same model. You can definitely do that (e.g. with several
Ecore Diagrams) but the model is the only one, as Ed already said.

cheers,
Jan



Thanks! Exact what I wanted!

Thanks for all replies!
Previous Topic:[CDO] ArrayStoreException on XML imported resource
Next Topic:[CDO] Customizing Repository Cloning
Goto Forum:
  


Current Time: Sun Oct 20 18:45:28 GMT 2019

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

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

Back to the top