[Uml-devel] JavaCodeGenerator
Brian Thomas
thomas at mail630.gsfc.nasa.gov
Sat Mar 1 08:19:25 UTC 2003
On Friday 28 February 2003 07:23 pm, JR wrote:
> > - multiplicity should be limited to a carrier class, not
> > transported about as a String that has to
> > be interpreted. IF someone uses older standards to specify
> > multiplicity, the code generator could
> > fail.
>
> A good idea. What older standards?
Well, I know that at one point multiplicity could be specified using plus sign
(argh.. I might be showing my age here, I think that happend in the pre-UML
days of Booch diagramming method, way back in the early 90's/late 80's).
So I guess the greatest danger these days is that the user specifies the multiplicity
incorrectly and the code cant recover the correct meaning.
> > that a given association obeys an
> > interface or class. This is in part because umbrello wont let
> > you diagram these type of associations.
>
> That would be a nice feature but quite tricky to do.
I agree, but ultimately its necessary to do any kind of semi-sophisticated code generation correctly
(at least in the Java/C++ world). I also wonder how to incorporate correct generation for
a number of other language-specific stuff like C++'s virtual methods, when to/when not to
make a method inline, etc. But some of this stuff isnt specifiable in UML anyways and would
have to be toggled on/off within an C++ extension of the code generation interface. Perhaps interfaces
for associations can be temporarily treated this way for now.
> > - description (comments) on association roles not carried
> > through. This is in part a failing of the association
> > model in umbrello.
>
> But shouldn't be too hard to add should it?
Agreed. I could add this when you tell me you are done hacking on the association class.
> > startline = "\n"+indent; // using UNIX newLine standard.. bad
> Why is that bad, \n is the one true line ending.
Heh. Yeah, I know you have tongue in cheek here, but it's still true. From what I understand, Qt
(and thus Umbrello) should theoretically compile on Windoze platforms (as well as Apple) so we
dont want to create just *NIX-specific code with the tool. There _should be_ a facility within Qt to
specify the correct platform end-line string (e.g. "/n" on *NIX, "/r/n" on Win and "/r" on Apple platforms),
but I couldnt find it. Any Qt experts out there with this knowledge??
> > // do people REALLY want these comments? Hmm.
>
> That being the comments marking public operations, private operations etc.
> I'm not honestly sure if they do.
An older programmer once told me that code comments are like sex...its better to have the bad than to
have none at all :)
-b.t.
More information about the umbrello-devel
mailing list