[Uml-devel] codegenerators

Sebastian Stein seb_stein at gmx.de
Fri Apr 4 01:38:07 UTC 2003


Brian Thomas <thomas at mail630.gsfc.nasa.gov> [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.

> For example, if you change an 
> 	operation in the code from "public" to "private" its clearly difficult to
> 	detect that in written code and make the correct change back in the
> 	UMLClass concerned.

In my basic approach it wouldn't be possible. I know a Case tool called
Case/4.0. They handle it like that. You can create a function an then call
the internal code editor. The editor only lets you edit the operation body,
not the "header".

The problem is, that the editor was just like a notepad with an additional
functionality, that some parts where not editable. I think in the UNIX
environment it is very important, that you shouldn't build another editor,
just use the allready existing ones. The only problem is, that you can't
mark some code parts as read-only.

> Even bigger problems result if you were to 
> 	rename an operation, propertie or class name in the code. I think editing,
> 	if it exists, should be done natively within umbrello. Embedding a 
> 	reasonable editor like kate is not out of the question.

As I said, such changes should be simply ignored and maybe the user should
be informed, that he has to change such things in Umbrello directly and not
in the code.

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 wasn't perfect, but it worked quit well.

Steinchen
-- 
Umbrello UML Modeller
Description     : UML diagram drawing tool for KDE with code generation
Homepage        : http://www.umbrello.org/




More information about the umbrello-devel mailing list