Home » Modeling » UML2 Tools » Generate Java code from UML model
Generate Java code from UML model [message #476548] |
Fri, 19 June 2009 08:16 |
Eclipse User |
|
|
|
Originally posted by: michael.gebhart.googlemail.com
Hi,
I've created some UML models (class diagrams) and now, I want to
generate the Java code skeletons. Is this possible?
I've tried to convert the UML models to an Ecore model and gen model and
generated the Java code. But now, I have my classes that inherit from
EObject and the code contains a lot of annotations. I only want to
generate plain Java objects. Is this possible with the Eclipse UML Tools
(I am already testing the Galileo release). Or is there an open source
plug-in available?
Greetings
Michael
|
|
| | | |
Re: Generate Java code from UML model [message #476554 is a reply to message #476549] |
Fri, 19 June 2009 21:52 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Michael,
what you have done is, you've created an Ecore-based DSL of your model.
In this case, your UML instance model was converted into a arbitrary
metamodel (M2). What you wanted to do is to generate code out of UML
instance model.
Therefore, as Rafael mentioned, there are severals projects, but none
out-of-the-box-solution. I can recommend JET2 and Acceleo. I've worked
with both and they are feasible for your problem.
HTH
/Timothy
Rafael Chaves schrieb:
> Michael, the UML2 Tools project deals with modeling only. You will find
> 3 different code generation solutions in the M2T project (which I added
> to the CC list): XPand, Acceleo and JET. Here is the project web site:
>
> http://www.eclipse.org/modeling/m2t/
>
> Cheers,
>
> Rafael
> http://abstratt.com/blog/
>
> Michael Gebhart wrote:
>> Hi,
>>
>> I've created some UML models (class diagrams) and now, I want to
>> generate the Java code skeletons. Is this possible?
>>
>> I've tried to convert the UML models to an Ecore model and gen model
>> and generated the Java code. But now, I have my classes that inherit
>> from EObject and the code contains a lot of annotations. I only want
>> to generate plain Java objects. Is this possible with the Eclipse UML
>> Tools (I am already testing the Galileo release). Or is there an open
>> source plug-in available?
>>
>> Greetings
>>
>> Michael
|
|
| | |
Re: Generate Java code from UML model [message #624301 is a reply to message #476548] |
Fri, 19 June 2009 09:05 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Michael,
I'll bet that in the end you need 95% of what EMF generates for you but
just don't realize it yet. After all, won't you need to be able persist
your instance as XML or to a data base, or build a UI for them? Note
that you can suppress EObject (Suppress EMF Types) and the @model
annotations (Suppress EMF Annotations) from the interfaces with settings
in the GenModel.
Michael Gebhart wrote:
> Hi,
>
> I've created some UML models (class diagrams) and now, I want to
> generate the Java code skeletons. Is this possible?
>
> I've tried to convert the UML models to an Ecore model and gen model
> and generated the Java code. But now, I have my classes that inherit
> from EObject and the code contains a lot of annotations. I only want
> to generate plain Java objects. Is this possible with the Eclipse UML
> Tools (I am already testing the Galileo release). Or is there an open
> source plug-in available?
>
> Greetings
>
> Michael
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: Generate Java code from UML model [message #624305 is a reply to message #476549] |
Fri, 19 June 2009 21:52 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Michael,
what you have done is, you've created an Ecore-based DSL of your model.
In this case, your UML instance model was converted into a arbitrary
metamodel (M2). What you wanted to do is to generate code out of UML
instance model.
Therefore, as Rafael mentioned, there are severals projects, but none
out-of-the-box-solution. I can recommend JET2 and Acceleo. I've worked
with both and they are feasible for your problem.
HTH
/Timothy
Rafael Chaves schrieb:
> Michael, the UML2 Tools project deals with modeling only. You will find
> 3 different code generation solutions in the M2T project (which I added
> to the CC list): XPand, Acceleo and JET. Here is the project web site:
>
> http://www.eclipse.org/modeling/m2t/
>
> Cheers,
>
> Rafael
> http://abstratt.com/blog/
>
> Michael Gebhart wrote:
>> Hi,
>>
>> I've created some UML models (class diagrams) and now, I want to
>> generate the Java code skeletons. Is this possible?
>>
>> I've tried to convert the UML models to an Ecore model and gen model
>> and generated the Java code. But now, I have my classes that inherit
>> from EObject and the code contains a lot of annotations. I only want
>> to generate plain Java objects. Is this possible with the Eclipse UML
>> Tools (I am already testing the Galileo release). Or is there an open
>> source plug-in available?
>>
>> Greetings
>>
>> Michael
|
|
| |
Goto Forum:
Current Time: Tue Sep 24 03:20:44 GMT 2024
Powered by FUDForum. Page generated in 0.05043 seconds
|