[Uml-devel] codegenerators

Brian Thomas thomas at mail630.gsfc.nasa.gov
Fri Apr 4 15:49:08 UTC 2003


	Im finishing work and dont have too much time to respond to all the comments
	on code generation, but I cant resist just one reply..

On Friday 04 April 2003 05:11 pm,  Sebastian wrote:
> Reply-To: Sebastian Stein <seb.stein at hpfsc.de>
>
> Brian Thomas <t> [030404 10:51]:
> > > > Another solution:
> > > >
> > > > - generate code in Umbrello
> > > > - start an editor through Umbrello
> > >
> > > I think this is a very a good idea. we only need an entrie in the
> > > properties dialog:  "command for editor = kate %f "
> >
> >       Well, IF you do this, it becomes seriously difficult to have
> > UMLObjects synced up to changes in the code.
>
> No, because the editor is only called for operation code. You wouldn't be
> able to load the whole class definition in the editor. Everything like
> class definition, class attribute/operation changes have to be done in
> Umbrello. Only adding code would be done by using an editor. So the whole
> design in Umbrello, only the implementation of operations in an editor.
>

	Well, I actually agree with this approach (mostly). I think people 
	on this list are getting overly ambitious about what can be accomplished
	and _should_ be accomplished by Umbrello. Like I have said before,
	I dont want to implement an IDE within Umbrello. The requirements for
	"code editing and generation" as I see it are the following:

	1. Be able to control parameters of code generation better. Language
	     specific parameters (such as whether or not to allow auto-generation
	     of accessor method for a given class, what kind of "list" variable to
	     use, etc) are controlable. 

	2. Be able to insert code into operations (including any accessor 
	methods too).

	3. Be able to insert arbitrary code/text into almost any point in a file.

	4. Be able to save these changes to code generation to a "template"

	There are other mentioned requirements on this list which I _dont_
	want to address and seem to center around the following :

	- have code editor which is able to do fancy things like code 
	highlighting, find/replace, auto-indenting, etc. In other words embed a
	 "real" editor within Umbrello.

	- have ablilty to set the type of embedded editor.

	- have changes made in the editor propagate back into UML diagrams.

	From my point of view, the code "viewer/editor" is very simple. It allows 
	you to inspect the type of code that will be created, it allows insertion of
	operation/method code and it remembers it. It also controls some code
	generation parameters, but changing things which are handled already
	by the UML diagrams is NOT allowed (e.g. renaming a class or 
	attribute). Having this kind of control will help solve the issue of syncing
	up the UML diagrams with generated code... Its just too hard at this 
	point to expect that changes made in the editor can feed back into UML
	diagrams. You need to implement a fancy solution here, like using code
	import/parsing, and even with existing tools, like ctags, this is still quite
	substantial work. So, we limit the kind of editing that may be done.
	Sure, its not super editor, but it is implementable and a good basis from
	which to work for u2 code generation/editor that might do more.

>
> To sum it up, the design is, that Umbrello has full control. It generates
> code, the user adds the functionality with an editor called by Umbrello. In
> practice you are going to miss a full featured IDE with all the help
> browsers and so on. We, in a software project some month ago, solved this
> problem by the following approach:
>
> a) generating the code with the Case tool
> b) editing the whole code in an IDE
> c) when coding was done, copy and pasting the code back into the internal
> Case editor

	
	This is more or less the point of view I have had all along. Do we 
	agree then?!?

	Happy weekend to all. 

								-b.t.






More information about the umbrello-devel mailing list