Home » Modeling » M2T (model-to-text transformation) » MTL & GMF
MTL & GMF [message #54990] |
Fri, 09 January 2009 03:29  |
Eclipse User |
|
|
|
Hi,
I am a newbie to MTL and GMF, so pls excuse me if I am off the
topic here.
From my understanding, it will be possible to use MTL to build
code generators (like C++, Java etc) that generate source code
from EMF based data models (such as UML2 that most Eclipse based
UML editors are based upon).
As far as I can understand, the code generator will then be
able to look at the data in EMF and adapt the generated code
dependent on the data settings inside the EMF datastructures
(UML2 in this case).
But what happens with UML products that add diagram specific
propery settings, such as the line color or font setting that
exist for many GUI objects in GMF generated diagram editors?
As far as I can understand, such GUI property settings are
purely part of the diagram editor, not the underlying EMF
datamodel (UML2).
Will an MTL based code generator be able to look at also these
(GMF/diagram specific) property settings and adapt the code
generation dependent on these GUI settings too?
Or do I need to create a UML profile to store custom specific
settings that can modify the behaviour in the code generator?
Or how do I otherwise add my own GUI property settings, that
can affect the code generator that is built using MTL (without
rewriting UML2)?
I.e, what I want to do is to use the EMF-based UML2 datastructures
together with a GMF generated diagram editor, and create a
code generator that modify its behaviour dependent on GUI settings
which does not exist in the origial EMF model (I don't want to
touch UML2 in this case).
Any information on this would be most helpful!
Kind regards,
Johan
|
|
| |
Re: MTL & GMF [message #55044 is a reply to message #55017] |
Fri, 09 January 2009 05:51   |
Eclipse User |
|
|
|
Originally posted by: johannes.nel.gmail.com
Johan,
my understanding:
you wants to create a (uml/ecore etc...) model from a gmf editor, and
that gmf editor would also store information affecting the main model.
This meta-model data you want to retrieve from the GMG gui.
if this is correct then i would consider a slight change in approach.
the information the gui stores (which affects the domain model) should
rather be stored in a seperate model, i would consider
(http://martinfowler.com/eaaDev/PresentationModel.html)
or some variation of it
there are a few listed at the bottom of this:
http://richnewman.wordpress.com/2008/02/26/model-view-presen ter-variations-on-the-basic-pattern-introduction-to-cabscsf- part-24/
then (from my limited jet based perspecitive), serializing that
meta-model to xml and loading it into your transformation as well
instead of getting it from the plugin.
laurent Goubet wrote:
> Hi Johan,
>
> I didn't really understand if you're trying to
> 1) generate code from an UML model created by a GMF modeler for UML files
> or
> 2) generate code from an UML meta-model for which you created a GMF modeler
>
> In both cases, there is a way to access both the UML data and the GUI
> information. For 1), you could create MTL generators on the GMF diagram
> which allows you to navigate to the UML model while having your GUI
> information at hand in the diagram.
>
> For 2), you'd need to create your generators targetting the gmfgen so
> that you can access all of : the UML meta-model, the gmfgraph, the
> gmftool ... that might be a lot of work :).
>
> If neither of those answer the question, feel free to correct my
> interpretations.
>
> Laurent
>
> Johan a écrit :
>> Hi,
>>
>> I am a newbie to MTL and GMF, so pls excuse me if I am off the topic
>> here.
>>
>> From my understanding, it will be possible to use MTL to build
>> code generators (like C++, Java etc) that generate source code
>> from EMF based data models (such as UML2 that most Eclipse based
>> UML editors are based upon).
>>
>> As far as I can understand, the code generator will then be
>> able to look at the data in EMF and adapt the generated code
>> dependent on the data settings inside the EMF datastructures
>> (UML2 in this case).
>>
>> But what happens with UML products that add diagram specific
>> propery settings, such as the line color or font setting that exist
>> for many GUI objects in GMF generated diagram editors?
>> As far as I can understand, such GUI property settings are
>> purely part of the diagram editor, not the underlying EMF
>> datamodel (UML2).
>>
>> Will an MTL based code generator be able to look at also these
>> (GMF/diagram specific) property settings and adapt the code generation
>> dependent on these GUI settings too?
>>
>> Or do I need to create a UML profile to store custom specific settings
>> that can modify the behaviour in the code generator?
>> Or how do I otherwise add my own GUI property settings, that
>> can affect the code generator that is built using MTL (without
>> rewriting UML2)?
>>
>> I.e, what I want to do is to use the EMF-based UML2 datastructures
>> together with a GMF generated diagram editor, and create a code
>> generator that modify its behaviour dependent on GUI settings
>> which does not exist in the origial EMF model (I don't want to
>> touch UML2 in this case).
>>
>> Any information on this would be most helpful!
>>
>> Kind regards,
>> Johan
>>
>>
>
|
|
|
Re: MTL & GMF [message #55071 is a reply to message #55044] |
Fri, 09 January 2009 08:25  |
Eclipse User |
|
|
|
Hello,
Thanks for the information! What I want to do is to create a code generator
for an UML product, there the code generator can adapt its behaviour based
on both the UML model stored in UML2 (which is EMF generated) as well as
some UML diagram editor (GMF generated, such as UML2Tools) specific GUI
settings which is not known to the UML2 but might be, say UML2Tools,
specific.
I will look into your suggestions. Thanks!
/Johan
|
|
|
Goto Forum:
Current Time: Wed Apr 30 16:09:20 EDT 2025
Powered by FUDForum. Page generated in 0.06057 seconds
|