Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » UML2 / JET
UML2 / JET [message #38489] Fri, 04 January 2008 11:56 Go to next message
Eclipse UserFriend
Originally posted by: dvanmil.gmail.com

Hello,

I want to use JET to generate code from UML2 diagrams.
I think the tools that are created in the Eclipse projects are great and I
would love to use them (ecore, UML, JET etc.)
What I really can't find I a good approach to generate code from UML2
diagrams that use profiles and sterotypes.

My questions :

1. Is it good plan to run the JET transformation direct on the UML2 ecore
model ?
According to
http://wiki.eclipse.org/JET_FAQ_Should_I_write_my_JET_code_g enerator_directly_against_UML2%3F
this is not the right way.
But what IS the best way to do it then and are there any real world
examples ?

2. How do I handle the profiles and stereotypes in this JET transformation.
I saw

http://wiki.eclipse.org/JET_FAQ_Can_JET_handle_UML_models_as _input%3F
http://wiki.eclipse.org/JET_FAQ_How_do_I_create_custom_XPath _Function%3F

I can't seem to find the exact approach to handle the profiles and
stereotypes in JET.
Should I load the profile as a seperate model and perform my own XPath
queries on them ?
Same question here : are there any real world examples (I saw the posts
of Juan Pedro Silva, but no solution ?)

3. Should I really convert the UML2 to ecore ?
How do I handle profiles and stereotypes then ?
They are not supported in ecore.
Is there a way to convert the profiles and stereotypes to other entities
(like eClasses ?) and is this the right way ? (it seems not to me).

4. Are there any complete working examples of generating code from UML2
including profiles and stereotypes ?

I would really be grateful if someone could show me the way, so I can go on
!

Greeting,

Daniel van Mil.
Re: UML2 / JET [message #38777 is a reply to message #38489] Mon, 07 January 2008 16:28 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Daniel:

Answers:

> 1. Is it good plan to run the JET transformation direct on the UML2 ecore
> model ?

No. But, I'm biased - I wrote the FAQ article. You may not buy the
arguments. Essentially, the FAQ recommends creating an intermediate model
that contains only the information necessary for the code generator. If you
(and your successors) are literate in UML, and your UML representation is
stable, then there may be little to gain from following the FAQ.

> 2. How do I handle the profiles and stereotypes in this JET
> transformation.

The only current way is via XPath functions. If there is interest, I will
see if I can develop some definitive examples.

> 3. Should I really convert the UML2 to ecore ?
> How do I handle profiles and stereotypes then ?

No. If you follow the advice of the FAQ, you would design a simpler EMF
model that contains only the information necessary for your code generator.
You would then create a transformation that reads a UML model (with your
profile) into this simplified model. This transformation would extract
information from stereotype applications and place them into appropriate
fields in the simpler model.

> 4. Are there any complete working examples of generating code from UML2
> including profiles and stereotypes ?
>

I do not have one in open source. But, I do have some using IBM's products -
contact me off list if you are interested.

Paul
Re: UML2 / JET [message #38809 is a reply to message #38777] Mon, 07 January 2008 21:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvanmil.gmail.com

Dear Paul,

Thanks for your advice!
I'm really interested in MDA development.

For your information : I want to use it to create several source files from
an UML2 model to use in different languages on different platforms.
These include : Java EJB3, Java JCR omc, Flex/Flash Actionscript classes
etc.
We also develop a web framework based on OSGi and Spring MVC with our own
company and maybe I want to use the MDA driven technology also here.
It seems very usefull to use the UML2 model to generate several classes for
different languages and platforms from one model.
Therefore I want to use stereotypes etc. to indicate that classes are
<Entity> classes, <Service> classes etc.

1. From my point of view it seems logical to run the transformation on the
UML model, because all the information is in the model and an extra
transformation seems not needed.
I have no experience at this point so I believe you if you say it's better
to do not so.
I do have experience in writing parsers/compilers and I know this is also
done in different phases which makes everythink easier (lexing, parsing
etc.)
I think this is the same idea.
Are there any good articles/examples on the subject of executing this task
in several stages and how this can be done best ?

2. Should the stereo types be transformed into Class UML artefacts and from
this ecore model be transformed in to source code ?

3. I'm very interested in existing tools and methods for this case. I find
the most MDA tools (like androMDA etc.) too complicated and huge for only
generation of some classes and really like the EMF/JET approach. I think
there's little documentation and especially good real life examples about
the EMF/JET framework.

4. Because there exists an UML2 project in Eclipse, I would expect the UML2
Xpath tags already to be present in the JET framework, which is not the case
I think ?
I think there must be at least 10 people who had the same problem and
implemented their own taglib. Would be nice if this would be standard.

5. A complete working example would be great. I'm also interested in the use
of IBM products, but would really like to use the free EMF/JET framework.

If you wish you can contact me at dvanmil@gmail.com.

Thanks and greeings from Holland,

Daniel van Mil (Software architect).

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:<fltk27$fm2$1@build.eclipse.org>...
> Daniel:
>
> Answers:
>
> > 1. Is it good plan to run the JET transformation direct on the UML2
> > ecore model ?
>
> No. But, I'm biased - I wrote the FAQ article. You may not buy the
> arguments. Essentially, the FAQ recommends creating an intermediate model
> that contains only the information necessary for the code generator. If
> you (and your successors) are literate in UML, and your UML representation
> is stable, then there may be little to gain from following the FAQ.
>
> > 2. How do I handle the profiles and stereotypes in this JET
> > transformation.
>
> The only current way is via XPath functions. If there is interest, I will
> see if I can develop some definitive examples.
>
> > 3. Should I really convert the UML2 to ecore ?
> > How do I handle profiles and stereotypes then ?
>
> No. If you follow the advice of the FAQ, you would design a simpler EMF
> model that contains only the information necessary for your code
> generator. You would then create a transformation that reads a UML model
> (with your profile) into this simplified model. This transformation would
> extract information from stereotype applications and place them into
> appropriate fields in the simpler model.
>
> > 4. Are there any complete working examples of generating code from UML2
> > including profiles and stereotypes ?
> >
>
> I do not have one in open source. But, I do have some using IBM's
> products - contact me off list if you are interested.
>
> Paul
>
Re: UML2 / JET [message #39135 is a reply to message #38489] Thu, 10 January 2008 23:32 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hi Daniel,

seems we're up to the same, I also need to generate code from
uml2models + someotherstuff. I have never used jet before but its
xslt/xpath similar style makes it a low cost entry.

I am still not sure whether i'll use Jet or oaW XPand. Jet is somehow
more transparent as its really just some xpath derivate while in
oaW I think there's too much magic stuff around.

I also questioned whether to first transform into an intermediate
model, I am not sure...


Hope to share progress,

Felix
Re: UML2 / JET [message #39535 is a reply to message #38809] Sun, 13 January 2008 02:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: carrasco.ModelDrivenDevelopment.co.uk

"Daniel van Mil" <dvanmil@gmail.com> wrote in message
news:flu42m$6nq$1@build.eclipse.org...
> Dear Paul,
>
> Thanks for your advice!
> I'm really interested in MDA development.
>
> For your information : I want to use it to create several source files
> from an UML2 model to use in different languages on different platforms.
> These include : Java EJB3, Java JCR omc, Flex/Flash Actionscript classes
> etc.
> We also develop a web framework based on OSGi and Spring MVC with our own
> company and maybe I want to use the MDA driven technology also here.
> It seems very usefull to use the UML2 model to generate several classes
> for different languages and platforms from one model.
> Therefore I want to use stereotypes etc. to indicate that classes are
> <Entity> classes, <Service> classes etc.
>
> 1. From my point of view it seems logical to run the transformation on the
> UML model, because all the information is in the model and an extra
> transformation seems not needed.
> I have no experience at this point so I believe you if you say it's better
> to do not so.
> I do have experience in writing parsers/compilers and I know this is also
> done in different phases which makes everythink easier (lexing, parsing
> etc.)
> I think this is the same idea.
> Are there any good articles/examples on the subject of executing this task
> in several stages and how this can be done best ?
>
> 2. Should the stereo types be transformed into Class UML artefacts and
> from this ecore model be transformed in to source code ?
>
> 3. I'm very interested in existing tools and methods for this case. I find
> the most MDA tools (like androMDA etc.) too complicated and huge for only
> generation of some classes and really like the EMF/JET approach. I think
> there's little documentation and especially good real life examples about
> the EMF/JET framework.
>
> 4. Because there exists an UML2 project in Eclipse, I would expect the
> UML2 Xpath tags already to be present in the JET framework, which is not
> the case I think ?
> I think there must be at least 10 people who had the same problem and
> implemented their own taglib. Would be nice if this would be standard.
>
> 5. A complete working example would be great. I'm also interested in the
> use of IBM products, but would really like to use the free EMF/JET
> framework.
>
> If you wish you can contact me at dvanmil@gmail.com.
>
> Thanks and greeings from Holland,
>
> Daniel van Mil (Software architect).
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:<fltk27$fm2$1@build.eclipse.org>...
>> Daniel:
>>
>> Answers:
>>
>> > 1. Is it good plan to run the JET transformation direct on the UML2
>> > ecore model ?
>>
>> No. But, I'm biased - I wrote the FAQ article. You may not buy the
>> arguments. Essentially, the FAQ recommends creating an intermediate model
>> that contains only the information necessary for the code generator. If
>> you (and your successors) are literate in UML, and your UML
>> representation is stable, then there may be little to gain from following
>> the FAQ.
>>
>> > 2. How do I handle the profiles and stereotypes in this JET
>> > transformation.
>>
>> The only current way is via XPath functions. If there is interest, I will
>> see if I can develop some definitive examples.
>>
>> > 3. Should I really convert the UML2 to ecore ?
>> > How do I handle profiles and stereotypes then ?
>>
>> No. If you follow the advice of the FAQ, you would design a simpler EMF
>> model that contains only the information necessary for your code
>> generator. You would then create a transformation that reads a UML model
>> (with your profile) into this simplified model. This transformation would
>> extract information from stereotype applications and place them into
>> appropriate fields in the simpler model.
>>
>> > 4. Are there any complete working examples of generating code from UML2
>> > including profiles and stereotypes ?
>> >
>>
>> I do not have one in open source. But, I do have some using IBM's
>> products - contact me off list if you are interested.
>>
>> Paul
>>
>
Re: UML2 / JET [message #39566 is a reply to message #38809] Sun, 13 January 2008 02:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: carrasco.ModelDrivenDevelopment.co.uk

Daniel,

I used to generate code from Eclipse UML2.1 metamodel instances,
with MOFscript, and was able to deal also with Stereotypes,
and even "crossing borders" to EMF metamodel instances (like annotations).

You may try and see if it
Re: UML2 / JET [message #39692 is a reply to message #39135] Tue, 15 January 2008 14:06 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
All:

There seems to be a fair bit of interest in better support for UML models in
JET. If we can get some community consensus on what the requirements are,
I'd would be happy to help in the effort. I have created:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=215339

which includes two possible ways of implementing support for UML profiles in
JET. Please feel free to add your comments there.

Finally, on the one-pass, two-pass approach, I think it comes down to your
level of familiarity with UML. In know that in the customer environments I
often encounter, familiarity with UML2 is a rarity. The idea of isolating
UML2 and visual representation from the the guts of a code generator is very
appealing in those environments. On the other hand, if you are UML literate
and think in UML shapes first, there is considerably less incentive to
separate these concerns. I'll make one last attempt to justify separating
those concerns, even for the UML expert.

1) Template-based code generators are best at replacing values, and at best,
doing simple calculations. If some information in your UML2 model requires
some significant massaging, you will end up with more readable templates
using an intermediate model specific to the code generator's needs.
2) One appeal of using templates is that they are fairly easy to pass to end
users to do some customization. To succeed, the end users must understand
the model the templates are accessing. A purpose-build intermediate model
will certainly be less complex than full blown UML2.

Thanks for considering JET.

Paul


"Felix Dorner" <felix_do@web.de> wrote in message
news:20080111003210.478dc5c3@serenity...
> Hi Daniel,
>
> seems we're up to the same, I also need to generate code from
> uml2models + someotherstuff. I have never used jet before but its
> xslt/xpath similar style makes it a low cost entry.
>
> I am still not sure whether i'll use Jet or oaW XPand. Jet is somehow
> more transparent as its really just some xpath derivate while in
> oaW I think there's too much magic stuff around.
>
> I also questioned whether to first transform into an intermediate
> model, I am not sure...
>
>
> Hope to share progress,
>
> Felix
>
Previous Topic:Re: Exctract eType from within eStructuralFeature using JET
Next Topic:[JET] About JET editor.
Goto Forum:
  


Current Time: Fri Apr 26 02:26:27 GMT 2024

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

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

Back to the top