Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Using Different Model & Diagram File
Using Different Model & Diagram File [message #175070] Mon, 03 March 2008 07:22 Go to next message
Eclipse UserFriend
Originally posted by: kamesh.sampath.gmail.com

Hi,

I am trying to follow the example and do the "Integrating EMF and GMF
Generated Editors by by Volker Wegert and Alex Shatalin".

What are the problems that we will be facing when we use seperate file for
model and diagram , how to work around that ?

The reason am asking this is because ideally we will be using the model to
generate the Code , it will be easier to write the templates when the
model has only the EMF objects and no diagram elements.

Also it will the XML parser will consume less time when parsing a small
file instead of the big files (both diagram + model together)

~Kamesh
Re: Using Different Model & Diagram File [message #175124 is a reply to message #175070] Mon, 03 March 2008 12:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Kamesh,

If I understand the issues I've seen correctly, when you keep the model
in separate resource, it's obviously far easier for the diagram and the
model to be out of sync since you can change the model and save it
without have touched the diagram. So an important consideration is what
form do the URI references from the diagram to the model take. If they
are based on IDs, you'll generally be in good shape most of the time
since broken references can be discovered quite easily to be repaired
and IDs don't generally change. If you use the default EMF fragment
paths that are used in the absence of IDs, you're more likely to get
intro trouble since such references are based on position and location
in the resource and hence moving, removing, or adding objects can make a
reference refer to a different object than before. EReference.eKeys can
help make such references more robust by making the reference into a
list be based on attribute values of the referenced object.


Kamesh Sampath wrote:
>
> Hi,
>
> I am trying to follow the example and do the "Integrating EMF and GMF
> Generated Editors by by Volker Wegert and Alex Shatalin".
>
> What are the problems that we will be facing when we use seperate file
> for model and diagram , how to work around that ?
>
> The reason am asking this is because ideally we will be using the
> model to generate the Code , it will be easier to write the templates
> when the model has only the EMF objects and no diagram elements.
> Also it will the XML parser will consume less time when parsing a
> small file instead of the big files (both diagram + model together)
>
> ~Kamesh
>
Re: Using Different Model & Diagram File [message #176690 is a reply to message #175070] Tue, 11 March 2008 20:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.volker-wegert.de

Hi!

kamesh.sampath@gmail.com (Kamesh Sampath) writes:
> I am trying to follow the example and do the "Integrating EMF and GMF
> Generated Editors by by Volker Wegert and Alex Shatalin".
>
> What are the problems that we will be facing when we use seperate file for
> model and diagram , how to work around that ?

The main problem is that in this case, you only have the model file in your
EMF generated editor and then have to
1. find out how the corresponding diagram file should be named
2. find out if the diagram file exists
3. if it doesn't exist, create it on-the-fly
4. load the diagram file into the existing environment
5. assemble a new input object and pass it on to the graphical editor

I'll see whether I cann add a rough outline about how to do this to the
article.

> The reason am asking this is because ideally we will be using the model to
> generate the Code , it will be easier to write the templates when the model
> has only the EMF objects and no diagram elements.

Not really (BTDT). It depends on your generator framework. In my current
project, I use oAW and just pass the reference to my top-level model object
into the Workflow runner. For other frameworks, this should be equally simple
- if in doubt, use a M2M conversion to throw out everything you don't need.

> Also it will the XML parser will consume less time when parsing a small file
> instead of the big files (both diagram + model together)

....how many millions of target files do you want to generate per second? ;-)

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
This is the Time Travelling Agency's answering machine. We're closed right now
but leave a message before the beep and we might have called you back.
Re: Using Different Model & Diagram File [message #176697 is a reply to message #175124] Tue, 11 March 2008 20:53 Go to previous message
Eclipse UserFriend
Originally posted by: mail.volker-wegert.de

Hi.

Ed Merks <merks@ca.ibm.com> writes:
> Kamesh Sampath wrote:
>> I am trying to follow the example and do the "Integrating EMF and GMF
>> Generated Editors by by Volker Wegert and Alex Shatalin".
>> What are the problems that we will be facing when we use seperate file for
>> model and diagram , how to work around that ?
> If I understand the issues I've seen correctly, when you keep the model in
> separate resource, it's obviously far easier for the diagram and the model
> to be out of sync since you can change the model and save it without have
> touched the diagram.

That's usually what you'd implement a single joint editor for. To avoid this,
I mean. But thanks for the warning - another bit for the article.

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
A computer scientist is someone who, when told to "Go to Hell", sees the "go
to", rather than the destination, as harmful.
Previous Topic:[Diagram partioning] Palette tool problem
Next Topic:define anchors (should this be a FAQ?)
Goto Forum:
  


Current Time: Thu Apr 25 12:58:46 GMT 2024

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

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

Back to the top