Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]UML Models and Java Models
[ATL]UML Models and Java Models [message #62459] Wed, 26 September 2007 05:48 Go to next message
Eclipse UserFriend
Originally posted by: wpf_neto.hotmail.com

Hi,

I’m a beginner user of ATL-DT plugin. I want do a transformation that its
input model is an UML Class Diagram from any UML tool (Magic Draw,
Poseidon, etc.) and its output model is the java code for this diagram.

Well, I did this transformation using this metamodel for UML:
http://www.eclipse.org/gmt/am3/zoos/atlanticZoo/#UML2
And this metamodel for Java code:
http://www.eclipse.org/gmt/am3/zoos/atlanticZoo/#JavaAbstrac tSyntax

So, I have two doubts:
1.Someone knows a material about how to do that an xmi generated by any
tool been an instance of UML2 Metamodel.
2.How I generate the java code from model (with all line commands)?

Thanks in advance,
Wilson Franck
Re: [ATL]UML Models and Java Models [message #62713 is a reply to message #62459] Wed, 26 September 2007 20:21 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

> I�m a beginner user of ATL-DT plugin. I want do a transformation that
> its input model is an UML Class Diagram from any UML tool (Magic Draw,
> Poseidon, etc.) and its output model is the java code for this diagram.
>
> Well, I did this transformation using this metamodel for UML:
> http://www.eclipse.org/gmt/am3/zoos/atlanticZoo/#UML2
> And this metamodel for Java code:
> http://www.eclipse.org/gmt/am3/zoos/atlanticZoo/#JavaAbstrac tSyntax
>
> So, I have two doubts:
> 1.Someone knows a material about how to do that an xmi generated by any
> tool been an instance of UML2 Metamodel.

Supporting every UML tool is very difficult to achieve:
- There are several versions of UML.
- Many tools have their own (incompatible) UML metamodels, derived from
a given official version.
- There are several versions of XMI.
- Many tools have their own (incompatible) implementation of XMI,
derived from a given official version.

In practice, one solution is to choose one UML metamodel as pivot, and
then build bridges to & from other tools. In your case, the pivot would
be UML2.


Note that if you use the UML2 metamodel available from the atlanticZoo,
you may have problems using specific features like profiles: the UML2
plugin implements most of the semantics of profiles in Java code.

Therefore, if you intend to use profiles, you should probably directly
use the UML2 plugin. To do this with ATL, instead of loading UML2.ecore,
you simply use the nsURI.

> 2.How I generate the java code from model (with all line commands)?

TCS (see http://wiki.eclipse.org/TCS) may be used. However, it is
usually more appropriate for DSLs (Domain-Specific Languages) than for
GPLs (General Purpose Languages) like Java.

Another solution is to use the model-to-text tools (see
http://wiki.eclipse.org/M2T).


Regards,

Frédéric Jouault
Previous Topic:Adding operation to ATL VM
Next Topic:Documentation
Goto Forum:
  


Current Time: Sun Dec 22 12:32:27 GMT 2024

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

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

Back to the top