[Uml-devel] Repeated parsing of source code and source code generation

Achim Spangler Achim.Spangler at mnet-online.de
Wed Mar 1 05:29:22 UTC 2006


Hi,

the current source code parser has no feature which allows the user to decide 
about detected differences betwen model and source code.
I think, that even the most intelligent parser needs user input to decide on:
+ function was CREATED in SOURCE 
   OR
   function was REMOVED in UML
   when the parser detects one more function in SOURCE than in UML

+ same vice versa ( one more function in UML and not in code )

+ different signature of functions
   a) changed just in UML _or_ source
   b) old version was _removed_ and parallel changed in other
        representation

Thus the parser should check for already existing classes in UML, before the 
UML representation is integrated in the project. In case of re-parsing of an 
already existing class, the parser should do:
1) build temporaty representation of the parsed class
2) create copy of the original representation of the class in UML
3) remove all items from both synchronizing representations as resolved, which
     are identically represented in both cases
3) ask user for each lasting item, that is comparable represented in the
    original class (see 2) and in the temporary class ( see 1) 
    -> let him choose BOTH, UML, SOURCE, NONE
   ( show user the signature of the item in question )
4) ask user in comparable way for all items which are only defined in ONE
     version

This procedure is comparable to the sync of contacts and calendars between 
computers and mobile phones/PDA ... . As their problems are more or less the 
same, we should have a look for their solution strategies.

##

Currently I know of nobody else who is using and adopting the source generator 
"xmi2code" for the current XMI syntax of umbrello.
This is sad, as I regard the xmi2code strategy as very good:
1) some control texts for return values and the like can be used to
     guard the source generator in the right way. This is important, as
     C++ provides some modelling strategies which are not matched by
     UML. Instead of urging the integration of all those features into
     umbrellos UML, xmi2code found its own way.

2) it preserves implemented functions, when xmi2code is called more than one
     time for the same class ( e.g. when some signature changes or additions
     were performed )


What about integrating the source generation strategies of xmi2code into 
umbrello, so that it gets an alternative solution for "native" source 
generation?


Bye,
Achim




More information about the umbrello-devel mailing list