Splitting a model into different files [message #426509] |
Fri, 09 January 2009 12:44 |
Eclipse User |
|
|
|
Originally posted by: csaad.gmx.net
Hi,
We have a graphical editor based on GEF with an underlying EMF model. In
order to store the layout information additional elements have been added
to the metamodel like the position and size of visible objects.
It is currently planned to remove this view specific information from the
model so that it will contain only the relevant domain.
The idea is to leave the view classes in the metamodel but to split up the
instances of the model into two different files: One that contains the
domain elements and one with the view objects (which are linked to the
domain elements through a containment reference). Is there a way to
achieve this, e.g. by telling EMF to put elements of a given type in
another resource?
Thanks for your help,
Chris
|
|
|
Re: Splitting a model into different files [message #426512 is a reply to message #426509] |
Fri, 09 January 2009 13:47 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Chris,
Comments below.
C. Saad wrote:
> Hi,
>
> We have a graphical editor based on GEF with an underlying EMF model.
> In order to store the layout information additional elements have been
> added to the metamodel like the position and size of visible objects.
Those should probably be outside the model. GMF uses the Notation model
for this type of thing.
> It is currently planned to remove this view specific information from
> the model so that it will contain only the relevant domain.
There you go. :-P
> The idea is to leave the view classes in the metamodel but to split up
> the instances of the model into two different files: One that contains
> the domain elements and one with the view objects (which are linked to
> the domain elements through a containment reference). Is there a way
> to achieve this, e.g. by telling EMF to put elements of a given type
> in another resource?
You have to put them in another resource yourself explicitly, but most
certainly this is possible. GMF does exactly this. You just need a
second notation model with references to the domain model and then store
them in two separate resources (just like the GenModel and the Ecore
model are separated).
>
> Thanks for your help,
> Chris
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03171 seconds