[Uml-devel] JavaCodeGenerator

Jonathan Riddell jr at jriddell.org
Fri Feb 28 12:58:09 UTC 2003


On Fri, 28 Feb 2003, Brian Thomas wrote:

Good work that man.

> 	Whew. What does this NOT do? Well, plenty.. but here are some
> top priorities (again, IMO):
>
> 	- 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?

> 	- No means to have a template that directs how code generation
> for that class (or indeed the whole
> 	package) is available. You cant have utillity methods that
> specify things like class->getName() is
> 	equivalent to class->getNameObject()->toString(). You cant have
> any other kind of constructor
> 	for the class other than the void constructor (e.g. new
> Class()). How do you get a method/field to
> 	specitfy an enumerated list (e.g. only a selected number of
> choices available) And so on.. there are
> 	many things that a template for the generation could fix (either
> because UML wont allow you to specify
> 	something or its a language specific construction that UML
> _isnt_ supposed to specify) in order to make
> 	code generation (not just for Java) truely usefull (and I will
> follow up this thought in a separate email
> 	with what to do about this in the umbrello project).

That would be nice too.

> 	- No class associations available. This means you cant specify
> 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.

> 	- 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?

> 	Thats all for now. COmments and suggestions on how to improve
> this code generator are welcome!!

Looks great to me.  I completed the comments for the methods in
javawriter.h, don't want to commit uncommented code.

	startline = "\n"+indent; // using UNIX newLine standard.. bad

Why is that bad, \n is the one true line ending.

	// 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.

Is there anything in this which should be run through i18n() ?

Jonathan Riddell






More information about the umbrello-devel mailing list