Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How can I generate code from my UML model using Eclipse?
How can I generate code from my UML model using Eclipse? [message #477746] Thu, 25 September 2008 09:00 Go to next message
Jens is currently offline JensFriend
Messages: 8
Registered: July 2009
Junior Member
Hello.

The UML2 FAQ states under "Can I generate code from my UML model?":
[...]Once you have an EMF representation of your model, you can, of
course, generate code from it using EMF.

Is that still the standard way to do it, exporting the whole thing to
ecore? I made an UML diagram using the UML tools and now want to generate
code from it.

I searched the internet for some time, but there seems to be no direct
answer to the simple beginner question:
"How can I generate code from my UML model using Eclipse?"
Re: How can I generate code from my UML model using Eclipse? [message #477747 is a reply to message #477746] Thu, 25 September 2008 11:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050508070107000305020902
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jens,

This tutorial shows how to generate code from an XML Schema:
< http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>


http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html

The same steps, but choosing early in the wizard that you want to load
from UML as opposed to XML Schema, should do the trick.


Jens wrote:
> Hello.
>
> The UML2 FAQ states under "Can I generate code from my UML model?":
> [...]Once you have an EMF representation of your model, you can, of
> course, generate code from it using EMF.
> Is that still the standard way to do it, exporting the whole thing to
> ecore? I made an UML diagram using the UML tools and now want to
> generate code from it.
>
> I searched the internet for some time, but there seems to be no direct
> answer to the simple beginner question:
> "How can I generate code from my UML model using Eclipse?"
>

--------------050508070107000305020902
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jens,<br>
<br>
This tutorial shows how to generate code from an XML Schema:<a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html"><br>
</a>
<blockquote><a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html"> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html</a><br>
</blockquote>
The same steps, but choosing early in the wizard that you want to load
from UML as opposed to XML Schema, should do the trick.<br>
<br>
<br>
Jens wrote:
<blockquote
cite="mid:7c21c292d5e417ce4fbedca36abd59dd$1@www.eclipse.org"
type="cite">Hello.
<br>
<br>
The UML2 FAQ states under "Can I generate code from my UML model?":
<br>
[...]Once you have an EMF representation of your model, you can, of
course, generate code from it using EMF. <br>
Is that still the standard way to do it, exporting the whole thing to
ecore? I made an UML diagram using the UML tools and now want to
generate code from it.
<br>
<br>
I searched the internet for some time, but there seems to be no direct
answer to the simple beginner question:
<br>
"How can I generate code from my UML model using Eclipse?"
<br>
<br>
</blockquote>
</body>
</html>

--------------050508070107000305020902--
Re: How can I generate code from my UML model using Eclipse? [message #477748 is a reply to message #477747] Thu, 25 September 2008 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed, Jens,

Importing your genmodel from UML gives you the benefit of certain
codegen extensions provided by UML2 to handle metamodeling constructs of
CMOF that EMOF (hence Ecore) does not implement: subsetting and
redefinition. Also, a handy foreign-method pattern for implementing
operations.

Say, Ed, on that subject: UML2's operations pattern is not UML-specific
but is quite convenient for models that employ multiple inheritance.
Have you considered adopting that pattern into EMF's codegen?

Cheers,

Christian


Ed Merks wrote:
> Jens,
>
> This tutorial shows how to generate code from an XML Schema:
> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>
>
> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>
> The same steps, but choosing early in the wizard that you want to load
> from UML as opposed to XML Schema, should do the trick.
>
>
> Jens wrote:
>> Hello.
>>
>> The UML2 FAQ states under "Can I generate code from my UML model?":
>> [...]Once you have an EMF representation of your model, you can, of
>> course, generate code from it using EMF.
>> Is that still the standard way to do it, exporting the whole thing to
>> ecore? I made an UML diagram using the UML tools and now want to
>> generate code from it.
>>
>> I searched the internet for some time, but there seems to be no direct
>> answer to the simple beginner question:
>> "How can I generate code from my UML model using Eclipse?"
>>
Re: How can I generate code from my UML model using Eclipse? [message #477749 is a reply to message #477748] Thu, 25 September 2008 13:56 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
I just updated the FAQ with these destails - Thanks Christian and Ed!

-James.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:gbg2h4$dks$1@build.eclipse.org...
> Hi, Ed, Jens,
>
> Importing your genmodel from UML gives you the benefit of certain codegen
> extensions provided by UML2 to handle metamodeling constructs of CMOF that
> EMOF (hence Ecore) does not implement: subsetting and redefinition.
> Also, a handy foreign-method pattern for implementing operations.
>
> Say, Ed, on that subject: UML2's operations pattern is not UML-specific
> but is quite convenient for models that employ multiple inheritance. Have
> you considered adopting that pattern into EMF's codegen?
>
> Cheers,
>
> Christian
>
>
> Ed Merks wrote:
>> Jens,
>>
>> This tutorial shows how to generate code from an XML Schema:
>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>
>> The same steps, but choosing early in the wizard that you want to load
>> from UML as opposed to XML Schema, should do the trick.
>>
>>
>> Jens wrote:
>>> Hello.
>>>
>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>> [...]Once you have an EMF representation of your model, you can, of
>>> course, generate code from it using EMF.
>>> Is that still the standard way to do it, exporting the whole thing to
>>> ecore? I made an UML diagram using the UML tools and now want to
>>> generate code from it.
>>>
>>> I searched the internet for some time, but there seems to be no direct
>>> answer to the simple beginner question:
>>> "How can I generate code from my UML model using Eclipse?"
>>>
Re: How can I generate code from my UML model using Eclipse? [message #477750 is a reply to message #477748] Thu, 25 September 2008 13:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
Christian,

I'm not sure what you mean by the operations pattern? Is this something
to do with defining static methods and delegating to them? (EMF
supports operations with bodies that handles multiple inheritance quite
reasonably...)


Christian W. Damus wrote:
> Hi, Ed, Jens,
>
> Importing your genmodel from UML gives you the benefit of certain
> codegen extensions provided by UML2 to handle metamodeling constructs
> of CMOF that EMOF (hence Ecore) does not implement: subsetting and
> redefinition. Also, a handy foreign-method pattern for implementing
> operations.
>
> Say, Ed, on that subject: UML2's operations pattern is not
> UML-specific but is quite convenient for models that employ multiple
> inheritance. Have you considered adopting that pattern into EMF's
> codegen?
>
> Cheers,
>
> Christian
>
>
> Ed Merks wrote:
>> Jens,
>>
>> This tutorial shows how to generate code from an XML Schema:
>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>
>>
>>
>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>
>>
>> The same steps, but choosing early in the wizard that you want to
>> load from UML as opposed to XML Schema, should do the trick.
>>
>>
>> Jens wrote:
>>> Hello.
>>>
>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>> [...]Once you have an EMF representation of your model, you can, of
>>> course, generate code from it using EMF.
>>> Is that still the standard way to do it, exporting the whole thing
>>> to ecore? I made an UML diagram using the UML tools and now want to
>>> generate code from it.
>>>
>>> I searched the internet for some time, but there seems to be no
>>> direct answer to the simple beginner question:
>>> "How can I generate code from my UML model using Eclipse?"
>>>
Re: How can I generate code from my UML model using Eclipse? [message #477751 is a reply to message #477750] Thu, 25 September 2008 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed,

Yes, that's what I was referring to. It serves the need of localizing
changes to a single implementation and also helps "purists" to keep Java
code out of their models. :-P

cW


Ed Merks wrote:
> Christian,
>
> I'm not sure what you mean by the operations pattern? Is this something
> to do with defining static methods and delegating to them? (EMF
> supports operations with bodies that handles multiple inheritance quite
> reasonably...)
>
>
> Christian W. Damus wrote:
>> Hi, Ed, Jens,
>>
>> Importing your genmodel from UML gives you the benefit of certain
>> codegen extensions provided by UML2 to handle metamodeling constructs
>> of CMOF that EMOF (hence Ecore) does not implement: subsetting and
>> redefinition. Also, a handy foreign-method pattern for implementing
>> operations.
>>
>> Say, Ed, on that subject: UML2's operations pattern is not
>> UML-specific but is quite convenient for models that employ multiple
>> inheritance. Have you considered adopting that pattern into EMF's
>> codegen?
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Ed Merks wrote:
>>> Jens,
>>>
>>> This tutorial shows how to generate code from an XML Schema:
>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>>
>>>
>>>
>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>
>>>
>>> The same steps, but choosing early in the wizard that you want to
>>> load from UML as opposed to XML Schema, should do the trick.
>>>
>>>
>>> Jens wrote:
>>>> Hello.
>>>>
>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>> [...]Once you have an EMF representation of your model, you can, of
>>>> course, generate code from it using EMF.
>>>> Is that still the standard way to do it, exporting the whole thing
>>>> to ecore? I made an UML diagram using the UML tools and now want to
>>>> generate code from it.
>>>>
>>>> I searched the internet for some time, but there seems to be no
>>>> direct answer to the simple beginner question:
>>>> "How can I generate code from my UML model using Eclipse?"
>>>>
Re: How can I generate code from my UML model using Eclipse? [message #477752 is a reply to message #477749] Thu, 25 September 2008 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Oo! Great.

I forgot to mention, also, the support for caching derived properties
using the CacheAdapter. I used to complain about the CacheAdapter a
lot, but I've really warmed to it of late. I'm a convert. :-)

cW

James Bruck wrote:
> I just updated the FAQ with these destails - Thanks Christian and Ed!
>
> -James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:gbg2h4$dks$1@build.eclipse.org...
>> Hi, Ed, Jens,
>>
>> Importing your genmodel from UML gives you the benefit of certain codegen
>> extensions provided by UML2 to handle metamodeling constructs of CMOF that
>> EMOF (hence Ecore) does not implement: subsetting and redefinition.
>> Also, a handy foreign-method pattern for implementing operations.
>>
>> Say, Ed, on that subject: UML2's operations pattern is not UML-specific
>> but is quite convenient for models that employ multiple inheritance. Have
>> you considered adopting that pattern into EMF's codegen?
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Ed Merks wrote:
>>> Jens,
>>>
>>> This tutorial shows how to generate code from an XML Schema:
>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>
>>> The same steps, but choosing early in the wizard that you want to load
>>> from UML as opposed to XML Schema, should do the trick.
>>>
>>>
>>> Jens wrote:
>>>> Hello.
>>>>
>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>> [...]Once you have an EMF representation of your model, you can, of
>>>> course, generate code from it using EMF.
>>>> Is that still the standard way to do it, exporting the whole thing to
>>>> ecore? I made an UML diagram using the UML tools and now want to
>>>> generate code from it.
>>>>
>>>> I searched the internet for some time, but there seems to be no direct
>>>> answer to the simple beginner question:
>>>> "How can I generate code from my UML model using Eclipse?"
>>>>
>
>
Re: How can I generate code from my UML model using Eclipse? [message #477753 is a reply to message #477751] Thu, 25 September 2008 14:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
Christian,

If it were an option, and someone else did all the work to
enable/support it, I'd consider that.


Christian W. Damus wrote:
> Hi, Ed,
>
> Yes, that's what I was referring to. It serves the need of localizing
> changes to a single implementation and also helps "purists" to keep
> Java code out of their models. :-P
>
> cW
>
>
> Ed Merks wrote:
>> Christian,
>>
>> I'm not sure what you mean by the operations pattern? Is this
>> something to do with defining static methods and delegating to them?
>> (EMF supports operations with bodies that handles multiple
>> inheritance quite reasonably...)
>>
>>
>> Christian W. Damus wrote:
>>> Hi, Ed, Jens,
>>>
>>> Importing your genmodel from UML gives you the benefit of certain
>>> codegen extensions provided by UML2 to handle metamodeling
>>> constructs of CMOF that EMOF (hence Ecore) does not implement:
>>> subsetting and redefinition. Also, a handy foreign-method pattern
>>> for implementing operations.
>>>
>>> Say, Ed, on that subject: UML2's operations pattern is not
>>> UML-specific but is quite convenient for models that employ multiple
>>> inheritance. Have you considered adopting that pattern into EMF's
>>> codegen?
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>>
>>> Ed Merks wrote:
>>>> Jens,
>>>>
>>>> This tutorial shows how to generate code from an XML Schema:
>>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>>>
>>>>
>>>>
>>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>>
>>>>
>>>> The same steps, but choosing early in the wizard that you want to
>>>> load from UML as opposed to XML Schema, should do the trick.
>>>>
>>>>
>>>> Jens wrote:
>>>>> Hello.
>>>>>
>>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>>> [...]Once you have an EMF representation of your model, you can,
>>>>> of course, generate code from it using EMF.
>>>>> Is that still the standard way to do it, exporting the whole thing
>>>>> to ecore? I made an UML diagram using the UML tools and now want
>>>>> to generate code from it.
>>>>>
>>>>> I searched the internet for some time, but there seems to be no
>>>>> direct answer to the simple beginner question:
>>>>> "How can I generate code from my UML model using Eclipse?"
>>>>>
Re: How can I generate code from my UML model using Eclipse? [message #477754 is a reply to message #477753] Thu, 25 September 2008 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed,

That's cool. Maybe James is interested in promoting some code out of
UML2? Otherwise, I can take a look at refactoring the templates. I
think I may be sufficiently motivated ta make the effort. :-) I will
probably come back to the newsgroup with questions.

cW


Ed Merks wrote:
> Christian,
>
> If it were an option, and someone else did all the work to
> enable/support it, I'd consider that.
>
>
> Christian W. Damus wrote:
>> Hi, Ed,
>>
>> Yes, that's what I was referring to. It serves the need of localizing
>> changes to a single implementation and also helps "purists" to keep
>> Java code out of their models. :-P
>>
>> cW
>>
>>

-----8<-----
Re: How can I generate code from my UML model using Eclipse? [message #477756 is a reply to message #477747] Thu, 25 September 2008 19:35 Go to previous message
Jens is currently offline JensFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks a lot. Now I can generate java code from my UML diagram.
Re: How can I generate code from my UML model using Eclipse? [message #626946 is a reply to message #477746] Thu, 25 September 2008 11:19 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050508070107000305020902
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jens,

This tutorial shows how to generate code from an XML Schema:
< http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>


http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html

The same steps, but choosing early in the wizard that you want to load
from UML as opposed to XML Schema, should do the trick.


Jens wrote:
> Hello.
>
> The UML2 FAQ states under "Can I generate code from my UML model?":
> [...]Once you have an EMF representation of your model, you can, of
> course, generate code from it using EMF.
> Is that still the standard way to do it, exporting the whole thing to
> ecore? I made an UML diagram using the UML tools and now want to
> generate code from it.
>
> I searched the internet for some time, but there seems to be no direct
> answer to the simple beginner question:
> "How can I generate code from my UML model using Eclipse?"
>

--------------050508070107000305020902
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jens,<br>
<br>
This tutorial shows how to generate code from an XML Schema:<a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html"><br>
</a>
<blockquote><a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html"> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html</a><br>
</blockquote>
The same steps, but choosing early in the wizard that you want to load
from UML as opposed to XML Schema, should do the trick.<br>
<br>
<br>
Jens wrote:
<blockquote
cite="mid:7c21c292d5e417ce4fbedca36abd59dd$1@www.eclipse.org"
type="cite">Hello.
<br>
<br>
The UML2 FAQ states under "Can I generate code from my UML model?":
<br>
[...]Once you have an EMF representation of your model, you can, of
course, generate code from it using EMF. <br>
Is that still the standard way to do it, exporting the whole thing to
ecore? I made an UML diagram using the UML tools and now want to
generate code from it.
<br>
<br>
I searched the internet for some time, but there seems to be no direct
answer to the simple beginner question:
<br>
"How can I generate code from my UML model using Eclipse?"
<br>
<br>
</blockquote>
</body>
</html>

--------------050508070107000305020902--
Re: How can I generate code from my UML model using Eclipse? [message #626947 is a reply to message #477747] Thu, 25 September 2008 13:08 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed, Jens,

Importing your genmodel from UML gives you the benefit of certain
codegen extensions provided by UML2 to handle metamodeling constructs of
CMOF that EMOF (hence Ecore) does not implement: subsetting and
redefinition. Also, a handy foreign-method pattern for implementing
operations.

Say, Ed, on that subject: UML2's operations pattern is not UML-specific
but is quite convenient for models that employ multiple inheritance.
Have you considered adopting that pattern into EMF's codegen?

Cheers,

Christian


Ed Merks wrote:
> Jens,
>
> This tutorial shows how to generate code from an XML Schema:
> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>
>
> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>
> The same steps, but choosing early in the wizard that you want to load
> from UML as opposed to XML Schema, should do the trick.
>
>
> Jens wrote:
>> Hello.
>>
>> The UML2 FAQ states under "Can I generate code from my UML model?":
>> [...]Once you have an EMF representation of your model, you can, of
>> course, generate code from it using EMF.
>> Is that still the standard way to do it, exporting the whole thing to
>> ecore? I made an UML diagram using the UML tools and now want to
>> generate code from it.
>>
>> I searched the internet for some time, but there seems to be no direct
>> answer to the simple beginner question:
>> "How can I generate code from my UML model using Eclipse?"
>>
Re: How can I generate code from my UML model using Eclipse? [message #626948 is a reply to message #477748] Thu, 25 September 2008 13:56 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
I just updated the FAQ with these destails - Thanks Christian and Ed!

-James.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:gbg2h4$dks$1@build.eclipse.org...
> Hi, Ed, Jens,
>
> Importing your genmodel from UML gives you the benefit of certain codegen
> extensions provided by UML2 to handle metamodeling constructs of CMOF that
> EMOF (hence Ecore) does not implement: subsetting and redefinition.
> Also, a handy foreign-method pattern for implementing operations.
>
> Say, Ed, on that subject: UML2's operations pattern is not UML-specific
> but is quite convenient for models that employ multiple inheritance. Have
> you considered adopting that pattern into EMF's codegen?
>
> Cheers,
>
> Christian
>
>
> Ed Merks wrote:
>> Jens,
>>
>> This tutorial shows how to generate code from an XML Schema:
>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>
>> The same steps, but choosing early in the wizard that you want to load
>> from UML as opposed to XML Schema, should do the trick.
>>
>>
>> Jens wrote:
>>> Hello.
>>>
>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>> [...]Once you have an EMF representation of your model, you can, of
>>> course, generate code from it using EMF.
>>> Is that still the standard way to do it, exporting the whole thing to
>>> ecore? I made an UML diagram using the UML tools and now want to
>>> generate code from it.
>>>
>>> I searched the internet for some time, but there seems to be no direct
>>> answer to the simple beginner question:
>>> "How can I generate code from my UML model using Eclipse?"
>>>
Re: How can I generate code from my UML model using Eclipse? [message #626949 is a reply to message #477748] Thu, 25 September 2008 13:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
Christian,

I'm not sure what you mean by the operations pattern? Is this something
to do with defining static methods and delegating to them? (EMF
supports operations with bodies that handles multiple inheritance quite
reasonably...)


Christian W. Damus wrote:
> Hi, Ed, Jens,
>
> Importing your genmodel from UML gives you the benefit of certain
> codegen extensions provided by UML2 to handle metamodeling constructs
> of CMOF that EMOF (hence Ecore) does not implement: subsetting and
> redefinition. Also, a handy foreign-method pattern for implementing
> operations.
>
> Say, Ed, on that subject: UML2's operations pattern is not
> UML-specific but is quite convenient for models that employ multiple
> inheritance. Have you considered adopting that pattern into EMF's
> codegen?
>
> Cheers,
>
> Christian
>
>
> Ed Merks wrote:
>> Jens,
>>
>> This tutorial shows how to generate code from an XML Schema:
>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>
>>
>>
>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>
>>
>> The same steps, but choosing early in the wizard that you want to
>> load from UML as opposed to XML Schema, should do the trick.
>>
>>
>> Jens wrote:
>>> Hello.
>>>
>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>> [...]Once you have an EMF representation of your model, you can, of
>>> course, generate code from it using EMF.
>>> Is that still the standard way to do it, exporting the whole thing
>>> to ecore? I made an UML diagram using the UML tools and now want to
>>> generate code from it.
>>>
>>> I searched the internet for some time, but there seems to be no
>>> direct answer to the simple beginner question:
>>> "How can I generate code from my UML model using Eclipse?"
>>>
Re: How can I generate code from my UML model using Eclipse? [message #626950 is a reply to message #477750] Thu, 25 September 2008 14:16 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed,

Yes, that's what I was referring to. It serves the need of localizing
changes to a single implementation and also helps "purists" to keep Java
code out of their models. :-P

cW


Ed Merks wrote:
> Christian,
>
> I'm not sure what you mean by the operations pattern? Is this something
> to do with defining static methods and delegating to them? (EMF
> supports operations with bodies that handles multiple inheritance quite
> reasonably...)
>
>
> Christian W. Damus wrote:
>> Hi, Ed, Jens,
>>
>> Importing your genmodel from UML gives you the benefit of certain
>> codegen extensions provided by UML2 to handle metamodeling constructs
>> of CMOF that EMOF (hence Ecore) does not implement: subsetting and
>> redefinition. Also, a handy foreign-method pattern for implementing
>> operations.
>>
>> Say, Ed, on that subject: UML2's operations pattern is not
>> UML-specific but is quite convenient for models that employ multiple
>> inheritance. Have you considered adopting that pattern into EMF's
>> codegen?
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Ed Merks wrote:
>>> Jens,
>>>
>>> This tutorial shows how to generate code from an XML Schema:
>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>>
>>>
>>>
>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>
>>>
>>> The same steps, but choosing early in the wizard that you want to
>>> load from UML as opposed to XML Schema, should do the trick.
>>>
>>>
>>> Jens wrote:
>>>> Hello.
>>>>
>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>> [...]Once you have an EMF representation of your model, you can, of
>>>> course, generate code from it using EMF.
>>>> Is that still the standard way to do it, exporting the whole thing
>>>> to ecore? I made an UML diagram using the UML tools and now want to
>>>> generate code from it.
>>>>
>>>> I searched the internet for some time, but there seems to be no
>>>> direct answer to the simple beginner question:
>>>> "How can I generate code from my UML model using Eclipse?"
>>>>
Re: How can I generate code from my UML model using Eclipse? [message #626951 is a reply to message #477749] Thu, 25 September 2008 14:24 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Oo! Great.

I forgot to mention, also, the support for caching derived properties
using the CacheAdapter. I used to complain about the CacheAdapter a
lot, but I've really warmed to it of late. I'm a convert. :-)

cW

James Bruck wrote:
> I just updated the FAQ with these destails - Thanks Christian and Ed!
>
> -James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:gbg2h4$dks$1@build.eclipse.org...
>> Hi, Ed, Jens,
>>
>> Importing your genmodel from UML gives you the benefit of certain codegen
>> extensions provided by UML2 to handle metamodeling constructs of CMOF that
>> EMOF (hence Ecore) does not implement: subsetting and redefinition.
>> Also, a handy foreign-method pattern for implementing operations.
>>
>> Say, Ed, on that subject: UML2's operations pattern is not UML-specific
>> but is quite convenient for models that employ multiple inheritance. Have
>> you considered adopting that pattern into EMF's codegen?
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Ed Merks wrote:
>>> Jens,
>>>
>>> This tutorial shows how to generate code from an XML Schema:
>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>
>>> The same steps, but choosing early in the wizard that you want to load
>>> from UML as opposed to XML Schema, should do the trick.
>>>
>>>
>>> Jens wrote:
>>>> Hello.
>>>>
>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>> [...]Once you have an EMF representation of your model, you can, of
>>>> course, generate code from it using EMF.
>>>> Is that still the standard way to do it, exporting the whole thing to
>>>> ecore? I made an UML diagram using the UML tools and now want to
>>>> generate code from it.
>>>>
>>>> I searched the internet for some time, but there seems to be no direct
>>>> answer to the simple beginner question:
>>>> "How can I generate code from my UML model using Eclipse?"
>>>>
>
>
Re: How can I generate code from my UML model using Eclipse? [message #626952 is a reply to message #477751] Thu, 25 September 2008 14:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31048
Registered: July 2009
Senior Member
Christian,

If it were an option, and someone else did all the work to
enable/support it, I'd consider that.


Christian W. Damus wrote:
> Hi, Ed,
>
> Yes, that's what I was referring to. It serves the need of localizing
> changes to a single implementation and also helps "purists" to keep
> Java code out of their models. :-P
>
> cW
>
>
> Ed Merks wrote:
>> Christian,
>>
>> I'm not sure what you mean by the operations pattern? Is this
>> something to do with defining static methods and delegating to them?
>> (EMF supports operations with bodies that handles multiple
>> inheritance quite reasonably...)
>>
>>
>> Christian W. Damus wrote:
>>> Hi, Ed, Jens,
>>>
>>> Importing your genmodel from UML gives you the benefit of certain
>>> codegen extensions provided by UML2 to handle metamodeling
>>> constructs of CMOF that EMOF (hence Ecore) does not implement:
>>> subsetting and redefinition. Also, a handy foreign-method pattern
>>> for implementing operations.
>>>
>>> Say, Ed, on that subject: UML2's operations pattern is not
>>> UML-specific but is quite convenient for models that employ multiple
>>> inheritance. Have you considered adopting that pattern into EMF's
>>> codegen?
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>>
>>> Ed Merks wrote:
>>>> Jens,
>>>>
>>>> This tutorial shows how to generate code from an XML Schema:
>>>> < http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
>>>>
>>>>
>>>>
>>>> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html
>>>>
>>>>
>>>> The same steps, but choosing early in the wizard that you want to
>>>> load from UML as opposed to XML Schema, should do the trick.
>>>>
>>>>
>>>> Jens wrote:
>>>>> Hello.
>>>>>
>>>>> The UML2 FAQ states under "Can I generate code from my UML model?":
>>>>> [...]Once you have an EMF representation of your model, you can,
>>>>> of course, generate code from it using EMF.
>>>>> Is that still the standard way to do it, exporting the whole thing
>>>>> to ecore? I made an UML diagram using the UML tools and now want
>>>>> to generate code from it.
>>>>>
>>>>> I searched the internet for some time, but there seems to be no
>>>>> direct answer to the simple beginner question:
>>>>> "How can I generate code from my UML model using Eclipse?"
>>>>>
Re: How can I generate code from my UML model using Eclipse? [message #626953 is a reply to message #477753] Thu, 25 September 2008 14:41 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Ed,

That's cool. Maybe James is interested in promoting some code out of
UML2? Otherwise, I can take a look at refactoring the templates. I
think I may be sufficiently motivated ta make the effort. :-) I will
probably come back to the newsgroup with questions.

cW


Ed Merks wrote:
> Christian,
>
> If it were an option, and someone else did all the work to
> enable/support it, I'd consider that.
>
>
> Christian W. Damus wrote:
>> Hi, Ed,
>>
>> Yes, that's what I was referring to. It serves the need of localizing
>> changes to a single implementation and also helps "purists" to keep
>> Java code out of their models. :-P
>>
>> cW
>>
>>

-----8<-----
Re: How can I generate code from my UML model using Eclipse? [message #626955 is a reply to message #477747] Thu, 25 September 2008 19:35 Go to previous message
Jens is currently offline JensFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks a lot. Now I can generate java code from my UML diagram.
Previous Topic:How can I generate code from my UML model using Eclipse?
Next Topic:Missing serialized package: uml.ecore
Goto Forum:
  


Current Time: Thu Apr 09 21:40:52 GMT 2020

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

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

Back to the top