Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Interdependency of EMF models
Interdependency of EMF models [message #430074] Sat, 09 May 2009 20:45 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello.

I define two EMF models with the help of the Sample ECore Model Editor.
Now I reference a class from model 1 in model 2 and vice versa.
Everything works fine, the Ecore model validates correctly, the Genmodel
is generated successfully. But when I click on Generate Model Code in
the Genmodel Editor, a progress monitor pops up, but closes instantly
and nothing is generated. If I remove one of the references (so that
there is no interdependency) then everything works fine.
Is interdependency not allowed? If yes, then an error message would be
nicer then simply don't generate anything and not informing at all.

Best regards,
Kai
Re: Interdependency of EMF models [message #430075 is a reply to message #430074] Sat, 09 May 2009 20:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Kai,

Interdependency is definitely allowed, as long as both packages are part
of a single GenModel. Any there clues in the Error Log? Feel free to
open a bugzilla with a sample that reproduces this inappropriate behavior.


Kai Schlamp wrote:
> Hello.
>
> I define two EMF models with the help of the Sample ECore Model
> Editor. Now I reference a class from model 1 in model 2 and vice versa.
> Everything works fine, the Ecore model validates correctly, the
> Genmodel is generated successfully. But when I click on Generate Model
> Code in the Genmodel Editor, a progress monitor pops up, but closes
> instantly and nothing is generated. If I remove one of the references
> (so that there is no interdependency) then everything works fine.
> Is interdependency not allowed? If yes, then an error message would be
> nicer then simply don't generate anything and not informing at all.
>
> Best regards,
> Kai


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Interdependency of EMF models [message #430077 is a reply to message #430075] Sat, 09 May 2009 20:56 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello Ed,

both are in seperate generator models. When setting up the generator
model, I add the other package (resp. genmodel) via "Reference generator
models" in the setup wizard.
So, this won't work?

Ed Merks wrote:
> Kai,
>
> Interdependency is definitely allowed, as long as both packages are part
> of a single GenModel. Any there clues in the Error Log? Feel free to
> open a bugzilla with a sample that reproduces this inappropriate behavior.
>
Re: Interdependency of EMF models [message #430078 is a reply to message #430077] Sat, 09 May 2009 21:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Kai,

I'm surprised it would let you. Perhaps you added dependencies after
creating the GenModel and didn't reload it? Interdependent packages
need to be initialized in an interdependent way and need to be generated
at the same time from a single GenModel....


Kai Schlamp wrote:
> Hello Ed,
>
> both are in seperate generator models. When setting up the generator
> model, I add the other package (resp. genmodel) via "Reference
> generator models" in the setup wizard.
> So, this won't work?
>
> Ed Merks wrote:
>> Kai,
>>
>> Interdependency is definitely allowed, as long as both packages are
>> part of a single GenModel. Any there clues in the Error Log? Feel
>> free to open a bugzilla with a sample that reproduces this
>> inappropriate behavior.
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Interdependency of EMF models [message #430083 is a reply to message #430078] Sun, 10 May 2009 15:30 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
It is possible, but not at first time setup. One has to create model A
without any dependeny and create the Genmodel for A. Now create model B
with dependeny to A and generate the Genmodel for B (with referencing
the A Genmodel). Now add to model A new references to model B and reload
the genmodel of A (with referencing Genmodel B).
This works without any error or warning info.

As I see it is possible to have two Ecore files for one Genmodel. Or to
have one Ecore (with subpackages) for one Genmodel.
Are there any advantages or disadvantages between those both designs?

Ed Merks wrote:
> Kai,
>
> I'm surprised it would let you. Perhaps you added dependencies after
> creating the GenModel and didn't reload it? Interdependent packages
> need to be initialized in an interdependent way and need to be generated
> at the same time from a single GenModel....
>
>
> Kai Schlamp wrote:
>> Hello Ed,
>>
>> both are in seperate generator models. When setting up the generator
>> model, I add the other package (resp. genmodel) via "Reference
>> generator models" in the setup wizard.
>> So, this won't work?
>>
>> Ed Merks wrote:
>>> Kai,
>>>
>>> Interdependency is definitely allowed, as long as both packages are
>>> part of a single GenModel. Any there clues in the Error Log? Feel
>>> free to open a bugzilla with a sample that reproduces this
>>> inappropriate behavior.
>>>
Re: Interdependency of EMF models [message #430086 is a reply to message #430083] Sun, 10 May 2009 16:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Kai,

Comments below.


Kai Schlamp wrote:
> It is possible, but not at first time setup. One has to create model A
> without any dependeny and create the Genmodel for A. Now create model
> B with dependeny to A and generate the Genmodel for B (with
> referencing the A Genmodel). Now add to model A new references to
> model B and reload the genmodel of A (with referencing Genmodel B).
I see. I suppose when you Reload... A it allows you to reference B but
really it should require B to be in the same GenModel. It sounds like
we need to add some more smarts to the wizard so that mutually dependent
models can't be split this way...
> This works without any error or warning info.
>
> As I see it is possible to have two Ecore files for one Genmodel. Or
> to have one Ecore (with subpackages) for one Genmodel.
> Are there any advantages or disadvantages between those both designs?
Generally you should consider that nesting of packages has no meaning.
They're just separate packages that happen to be nested. Personally I'd
avoid nesting packages...
>
> Ed Merks wrote:
>> Kai,
>>
>> I'm surprised it would let you. Perhaps you added dependencies after
>> creating the GenModel and didn't reload it? Interdependent packages
>> need to be initialized in an interdependent way and need to be
>> generated at the same time from a single GenModel....
>>
>>
>> Kai Schlamp wrote:
>>> Hello Ed,
>>>
>>> both are in seperate generator models. When setting up the generator
>>> model, I add the other package (resp. genmodel) via "Reference
>>> generator models" in the setup wizard.
>>> So, this won't work?
>>>
>>> Ed Merks wrote:
>>>> Kai,
>>>>
>>>> Interdependency is definitely allowed, as long as both packages are
>>>> part of a single GenModel. Any there clues in the Error Log?
>>>> Feel free to open a bugzilla with a sample that reproduces this
>>>> inappropriate behavior.
>>>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:eodm?
Next Topic:How to extends an EObject with the Serializable interface
Goto Forum:
  


Current Time: Thu Mar 28 19:29:47 GMT 2024

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

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

Back to the top