[Uml-devel] Re: Test xmi file for code generation
Sebastian Stein
seb.stein at hpfsc.de
Wed May 7 13:49:05 UTC 2003
Brian Thomas <thomas at mail630.gsfc.nasa.gov> [030507 20:42]:
> I have not done too much work on the XMI storage of the code at this time.
> If you have ideas, I am happy to hear them and work with you to develop
> something acceptable. My only thought is that we just need to store the
> code within the operations (and including any accessor methods). IF the
> code is auto-generated by Umbrello, then we may want to also flag that in
> the XMI file, but, of course, we dont need to actually keep any code there.
>
> Whatever system we develop, it should be general enough to work with most,
> if not all, of the code that Umbrello can generate (which means that all the
> XMI code generation nodes need to identify which kind of code they are
> creating.. so each code generator needs to have a unique string/id like
> "Cpp", "Csharp", "Perl", etc. and the node looks like:
>
> <code language="Cpp" isAccessorMethod="true"> .. code in CDATA block </code>
>
> I would probably like to default to CDATA sections for the code blocks
> since that way no unkosher characters are dropped or translated by the XML
> representation.
Isn't it possible to link external files from within a XML file? Maybe this
would be another solution, to save the code in other files. If this doesn't
work with XML, I think it would be the best to store it as CDATA block.
Maybe there would be a problem in loosing code format like tabs and so on.
> Thoughts?
Well, while I was looking at the code of the code generators, I thought that
they are very well, but that it is wrong how we classified the whole thing.
We have a class of code generators, maybe in the future we would have a
class of code parsers (import) and maybe we would have a class of code
templates to provide program language specific datatypes or something like
that. That is the current architecture I think.
But I thought it might be better to have a plugin for C++ support providing
a parser, generator and a C++ template thing (I really don't know how to
call it). The same for Java, Ada, IDL, C# ...
Don't get me wrong, in question of implementation, all code generators will
have the same abstract base class of course. But if we go like I said, the
active language would have a more powerful meaning. It would mean that you
can select during operation or attribut creation only datatypes provided by
the e.g. C++ plugin.
So I hope you understand what I mean, because it is hard to describe in a
non native language ;-)
Steinchen
PS: I've forwarded this messages to uml-devel as well...
--
http://www.hpfsc.de/ - die Seite rund um:
Assembler, Bundeswehr, TFT LCDs, Halle/Saale, Fahrradtouren,
Wanderstaat Mauma, Raumschiff USS Nathan, Enemy Room, MLCAD Tutorial
More information about the umbrello-devel
mailing list