Code Generation from UML models 1

Ákos Frohner, Zoltán Porkoláb
Department of General Computer Science,
University Eötvös Loránd, Budapest
E-mail: Akos.Frohner@elte.hu, Zoltan.Porkolab@elte.hu,

Keywords: UML model, code generation, component, metadata, multi-paradigm

Classification: 3 year´s work (PhD almost completed)


1 Introduction

Creating a generic, object-oriented, component-based, transactional business system, which covers the whole lifecycle, is possible only with integration of commercial tools, component technologies, recently developed class libraries and using code generators. Most of the recently used tools for development techniques are focusing only of one the layers of the model from the code generation point of view. As a consequence the inter-layer connections are lost in the generated code.


2 Design Model Generation

We describe a code generator technique, which uses an analysis model as a starting point and generates the following model layers or sub-models directly:

The sub-models are specialised for the target domain: they contain interfaces, classes and methods specific to the target language.

To allow modifications at each level we give an algorithm to re-generate the sub-models. The formally described graph transformation preserves the modifications made in the sub-model and merges the changes from the analysis model.


3 Code Generation

Based on the experiences with 4GL systems it is obvious the need to provide customisation in the generated code as well. The source code can be geenrated in the same manner as the sub-models are generated and re-generated.

The sub-model generation algorithm can be implemented as a transformation on the model graph, but one does not have this clean architecture if the target graph is projected into source code. Although it is possible to reverse engineer source code into model graphs, but it is a never ending battle to follow the changes of the target languages in these tools.

We intend to delegate the actual graph transformations on the source code level to the most appropriate tools, to the compilers itself, thus we offer a multi-paradigm approach [1]. We let the developer to choose the best solution for her or his target language and problem domain:




References

[1]
Jim Coplien: Multi Paradigm Design for C++, 1998, Addison- Wesley, ISBN: 0-201-82467-1
[2]
Barbara Liskov: Data Abstraction and Hierarchy, SIGPLAN Notices 23, 5. May 1988
[3]
Gregor Kiczales: Aspect Oriented Programming, AOP Computing surveys 28(es), 1996 p.154

1

This work has been supported by the Grants OMFB ALK-00229/98


Frohner Ákos
Porkoláb Zoltán
Last modified: Mon Sep 4 14:24:24 MST 2000