Re: Code generation from UML model [message #624052] |
Tue, 24 July 2007 16:03 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Lutz,
Sorry about the delayed response.
Some comments below ...
- James.
"Lutz Wrage" <lw_mailme_00@yahoo.com> wrote in message
news:f7qa3i$lg0$1@build.eclipse.org...
> I've been experimenting with the uml code generator a bit, and I found
> that it works fine. I want to use unions, subsets, and redefinitions in
> my metamodel. Also, I like the pluralized getters. To generate code I
> create a class diagram, create a genmodel from the *.uml file, and
> generate model code from that.
>
> I have two questions:
>
> - In the article on heavyweight extensions the UML model is converted to
> a metamodel before code generation. Does this cause any change to the
> generated code? I my experiments it did not make any difference in the
> generated model code.
You are absolutely correct, that is not required and has no impact on code
generation. It was done in the article in an attempt to be complete but it
is not required as you have discovered. I will update the article.
>
> - The article also recommends applying the ecore profile and applying
> epackage, eclass, etc stereotypes to the metaclasses. Again, how does
> this influence the generated model code? I couldn't see any difference
> in my simple example.
Applying the ecore profile with stereotypes etc. is required and does have
an impact on code generation.
There is extra information that can be added in the stereotypes and that
information has direct impact on code generation.
In some cases, the mere prescence of the stereotype has impact on code
generation.
>
> I tried to find a place in the code generator sources or templates where
> these stereotypes are processed, but couldn't find it.
Have a look at the UML2EcoreConverter in the processEcoreTaggedValue(...)
or in the body of the converter to see how the stereotypes are processed.
>
> Thanks,
> Lutz
|
|
|
Powered by
FUDForum. Page generated in 0.02708 seconds