Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Java code Generation from UML diagrams
Java code Generation from UML diagrams [message #474242] Tue, 22 April 2008 01:39 Go to next message
Eclipse UserFriend
Originally posted by: msbedwards.comcast.net

Hello.
I'm new to Eclipse and UML modeling. My professor has recommended that we
use Eclipse to develop UML models which will then be used to generate
executable Java code. I've successfully created the models, but am having
problems finding tutorials which explain, in detail, how I would transform
the models into Java code. Could someone suggest a tutorial I could use?

Thank you in advance for the help.

Belinda
Re: Java code Generation from UML diagrams [message #474243 is a reply to message #474242] Tue, 22 April 2008 05:59 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Belinda wrote:
> Hello.
> I'm new to Eclipse and UML modeling. My professor has recommended that
> we use Eclipse to develop UML models which will then be used to generate
> executable Java code. I've successfully created the models, but am
> having problems finding tutorials which explain, in detail, how I would
> transform the models into Java code. Could someone suggest a tutorial I
> could use?


Hey Belinda,

did you already find a tool that helps you with the generation? If not, you have
several options. I'd suggest you check out the m2t project:

http://www.eclipse.org/modeling/m2t/

It provides several subprojects that help you to generate text from emf based
models (which UML2 is). Once you decide for a language, you can look if there's
any tutorial for it. Usually though the tutorials are for simpler input models ,
i've only the one from openarchitectureware.org (xText) manual:

http://www.eclipse.org/gmt/oaw/doc/4.2/openArchitectureWare- 42-reference.pdf

Felix
Re: Java code Generation from UML diagrams [message #474246 is a reply to message #474243] Wed, 23 April 2008 00:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: MsBEdwards.comcast.net

Thank you, Felix.
I'll check this out. I was able to find the "Generating an EMF Model"
tutorial, but it didn't give me exactly what I needed; I'll definately try
this.

Thanks again!
Belinda
Re: Java code Generation from UML diagrams [message #474247 is a reply to message #474246] Wed, 23 April 2008 14:04 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Belinda wrote:
> Thank you, Felix.
> I'll check this out. I was able to find the "Generating an EMF Model"
> tutorial, but it didn't give me exactly what I needed; I'll definately
> try this.

Hey Belinda,

note that EMF/Ecore models are not the same as UML Models. Its a bit
confusing at first, but you´ll find out.

I´d suggest you to read the EMF Overview, even if you´re going to work
with UML Models later. The UML2 wiki has some articles that show you
what´s going on behind the curtain when you draw your diagrams.

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.html
http://wiki.eclipse.org/MDT-UML2


Felix
Re: Java code Generation from UML diagrams [message #474399 is a reply to message #474247] Wed, 30 April 2008 12:24 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hello Belinda,
Felix is correct, UML is converted to EMF, Java code is generated from EMF
file.

Diagram is described by two files - semantic model file(*.uml) and notational
model file (*.umlclass_diagram). Notation describes how UML elements a shown
and placed on the diagram; semantic model is UMl model itself, it's what
we will use in our subsequent code generation.

At the moment algorithm to generate Java code from UML diagram is the following:

1. Convert UML to EMF
Select *.uml file and launch New/Eclipse Modeling Framework/EMF model wizard.

Leave 'UML model' as a model importer on the second page.
Click 'Load' button, then click 'Process all' button on the third page.
Press 'Finish' on the forth page.

2. Generate Java from EMF
Open just-created *.genmodel file, select package and call 'Generate Model'
action.
Generated code is what you want. More details about code-generation are in
paper Felix gave ( http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.html)


Best wishes,
Tatiana.

> Belinda wrote:
>
>> Thank you, Felix.
>> I'll check this out. I was able to find the "Generating an EMF
>> Model"
>> tutorial, but it didn't give me exactly what I needed; I'll
>> definately
>> try this.
> Hey Belinda,
>
> note that EMF/Ecore models are not the same as UML Models. Its a bit
> confusing at first, but you?ll find out.
>
> I?d suggest you to read the EMF Overview, even if you?re going to work
> with UML Models later. The UML2 wiki has some articles that show you
> what?s going on behind the curtain when you draw your diagrams.
>
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//r
> eferences/overview/EMF.html http://wiki.eclipse.org/MDT-UML2
>
> Felix
>
Re: Java code Generation from UML diagrams [message #619695 is a reply to message #474242] Tue, 22 April 2008 05:59 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Belinda wrote:
> Hello.
> I'm new to Eclipse and UML modeling. My professor has recommended that
> we use Eclipse to develop UML models which will then be used to generate
> executable Java code. I've successfully created the models, but am
> having problems finding tutorials which explain, in detail, how I would
> transform the models into Java code. Could someone suggest a tutorial I
> could use?


Hey Belinda,

did you already find a tool that helps you with the generation? If not, you have
several options. I'd suggest you check out the m2t project:

http://www.eclipse.org/modeling/m2t/

It provides several subprojects that help you to generate text from emf based
models (which UML2 is). Once you decide for a language, you can look if there's
any tutorial for it. Usually though the tutorials are for simpler input models ,
i've only the one from openarchitectureware.org (xText) manual:

http://www.eclipse.org/gmt/oaw/doc/4.2/openArchitectureWare- 42-reference.pdf

Felix
Re: Java code Generation from UML diagrams [message #619698 is a reply to message #474243] Wed, 23 April 2008 00:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: MsBEdwards.comcast.net

Thank you, Felix.
I'll check this out. I was able to find the "Generating an EMF Model"
tutorial, but it didn't give me exactly what I needed; I'll definately try
this.

Thanks again!
Belinda
Re: Java code Generation from UML diagrams [message #619699 is a reply to message #474246] Wed, 23 April 2008 14:04 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Belinda wrote:
> Thank you, Felix.
> I'll check this out. I was able to find the "Generating an EMF Model"
> tutorial, but it didn't give me exactly what I needed; I'll definately
> try this.

Hey Belinda,

note that EMF/Ecore models are not the same as UML Models. Its a bit
confusing at first, but you´ll find out.

I´d suggest you to read the EMF Overview, even if you´re going to work
with UML Models later. The UML2 wiki has some articles that show you
what´s going on behind the curtain when you draw your diagrams.

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.html
http://wiki.eclipse.org/MDT-UML2


Felix
Re: Java code Generation from UML diagrams [message #619701 is a reply to message #474247] Wed, 30 April 2008 12:24 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hello Belinda,
Felix is correct, UML is converted to EMF, Java code is generated from EMF
file.

Diagram is described by two files - semantic model file(*.uml) and notational
model file (*.umlclass_diagram). Notation describes how UML elements a shown
and placed on the diagram; semantic model is UMl model itself, it's what
we will use in our subsequent code generation.

At the moment algorithm to generate Java code from UML diagram is the following:

1. Convert UML to EMF
Select *.uml file and launch New/Eclipse Modeling Framework/EMF model wizard.

Leave 'UML model' as a model importer on the second page.
Click 'Load' button, then click 'Process all' button on the third page.
Press 'Finish' on the forth page.

2. Generate Java from EMF
Open just-created *.genmodel file, select package and call 'Generate Model'
action.
Generated code is what you want. More details about code-generation are in
paper Felix gave ( http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.html)


Best wishes,
Tatiana.

> Belinda wrote:
>
>> Thank you, Felix.
>> I'll check this out. I was able to find the "Generating an EMF
>> Model"
>> tutorial, but it didn't give me exactly what I needed; I'll
>> definately
>> try this.
> Hey Belinda,
>
> note that EMF/Ecore models are not the same as UML Models. Its a bit
> confusing at first, but you?ll find out.
>
> I?d suggest you to read the EMF Overview, even if you?re going to work
> with UML Models later. The UML2 wiki has some articles that show you
> what?s going on behind the curtain when you draw your diagrams.
>
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//r
> eferences/overview/EMF.html http://wiki.eclipse.org/MDT-UML2
>
> Felix
>
Re: Java code Generation from UML diagrams [message #1448480 is a reply to message #474242] Mon, 20 October 2014 02:06 Go to previous messageGo to next message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 1
Registered: October 2014
Junior Member
UML modeling is really old. The best way to me to model my application is at the database level. So I build out my database model and then use Jigy Generator (created by the getjigy team) to create my application. I just fill out a simple form and Jigy Generator reverse engineers my database into a fully configured Spring MVC Java web application. All of my DAO's, domain objects and validators are created for me... these really represent my data model. Also it has some built features that just work out of the box like login, authentication, file upload, etc. If you're like me and don't like starting your java projects from scratch, you should give Jigy Generator a try.
Re: Java code Generation from UML diagrams [message #1533047 is a reply to message #1448480] Sun, 28 December 2014 10:08 Go to previous message
Harshad Mahajan is currently offline Harshad MahajanFriend
Messages: 1
Registered: December 2014
Junior Member
Hi Andrew,

I tried my hand at Jigy Generator, without much success. I am trying hard to get it to work.

I am facing challenge in generating eclipse project using Jigy Generator 1.0.4. After providing the mandatory information on the create project page, the download page never appears. The orbiting hour glass overlay never goes away. (Sidenote: I checked using firebug, the HTTP request received a response "Success".)

Can you share with me how have you setup your Jigy Generator and the database?

mahajan.harshad@gmail.com
Previous Topic:Unable to load UML model in stand alone application
Next Topic:Install UML2 for Luna
Goto Forum:
  


Current Time: Wed Apr 24 15:19:58 GMT 2024

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

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

Back to the top