|Re: Code generation from UML model [message #624052]
||Tue, 24 July 2007 16:03
| james bruck
Registered: July 2009
Sorry about the delayed response.
Some comments below ...
"Lutz Wrage" <email@example.com> wrote in message
> 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
> 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.
Powered by FUDForum
. Page generated in 0.01297 seconds