solely offered by nearly all state-of-the-art UML and
SysML modeling tools, most often is not adequate.
Instead generation of ANSI conformant C code would
be needed for those systems, as this still is the state-
of-the-practice implementation language (van Solin-
gen, 2004) for which approved compilers are avail-
able.
As we aim at providing mature model-driven en-
gineering for the domain of small embedded and real-
time software systems (Nyen and Lichter, 2007), we
introduced a code generationframework(Funk, 2006)
(Kevinc, 2007) to support the flexible and customiz-
able generation of ANSI-C code from UML models.
2 RELATED WORK
Many commercial MDE tools targeting the domain
of embedded and real-time systems exist on the mar-
ket (an inventory is provided by (Graaf et al., 2002),
a quite extensive comparison of case tools targeting
the embedded and real-time domain can be found in
(Sch¨atz et al., 2003)). Quite a few of those tools offer
UML modeling capabilities, as the UML has become
the predominant modeling language for MDE. Nearly
all of those tools supporting the UML do as well offer
direct code generation capabilities from UML mod-
els. However, as already mentioned, the offered gen-
eration capabilities are mostly inflexible and hard to
customize. Moreover, the generation of plain ANSI
conformant C code is often not supported. Instead,
most of the tools deliver proprietary runtime libraries
and concentrate on the generation of C++ code which
is not applicable to the domain of small embeddedand
real-time systems.
While commercially available tools thus only
marginally cover the regarded domain of small em-
bedded and real-time systems, academic approaches
do not seem to consider the domain at all. That
is, there are almost no approaches investigating the
generation of ANSI conformant C code from UML
models. The reason for this - as we think - is that
academic state-of-the-art and industrial state-of-the-
practice are separated by a time gap of around 10-15
years, so that real-world problems being relevant to
the regarded domain have simply gotten out of aca-
demic scope. That is, ANSI conformant C code gen-
eration from UML models has been inside academic
scope in the early days of the UML (e.g. the gener-
ation of C code from state machines or from simple
class diagrams), but after that not much research ef-
fort has been spent to those questions. For instance,
the generation of ANSI-C code from UML composite
structure or component diagrams, being introduced to
the UML in its recent version to especially address
embedded and real-time systems, has not been inves-
tigated yet.
The code generation framework we propose is in-
tended to fill the described gap. It allows for rapid de-
velopment of custom ANSI-C code generators as they
are required by the regarded domain of small embed-
ded and real-time systems. We see this as a prereq-
uisite for the successful application of MDE technol-
ogy.
3 REQUIREMENTS
Besides the fundamental functional requirement to
support the generation of ANSI-C code from UML
models, the most important requirement for our code
generation framework is - as already mentioned - a
non-functional, namely to be flexible and adaptable.
That is, the code generation process has to be such
that different transformation strategies, different ap-
plication domains, as well as different target plat-
forms are supported. Furthermore, as the code gen-
eration process may change over time, maintainance
has to be as straight-forward as possible.
In consequence, we demand that the code gener-
ation framework should have a very modular archi-
tecture, separating the logical transformation process
(i.e. how UML model elements are mapped to C lan-
guage constructs) from the rather technical process
of code generation. This way, changes to the logi-
cal transformation - which we consider to be the one
that most likely changes - can be done without affect-
ing the rather technical process of generating the C
language unit files which is considered to be rather
stable.
Eclipse has established itself as a de facto in-
dustry standard, and the related tools and technol-
ogy projects offer a mature C/C++ development en-
vironment (Eclipse CDT tools project (The Eclipse
Foundation, 2000a)) as well as underlying technol-
ogy for model-driven engineering based on UML
(Eclipse MDT (The Eclipse Foundation, 2000d) and
GMT (The Eclipse Foundation, 2000b) technology
projects). This led us to the decision to realize our
code generation framework based on that technology
as well. This way, it can be easily integrated with sev-
eral other UML and SysML modeling tools, as vari-
ous considerable tool manufacturers as IBM Rational,
Borland, Mentor Graphics, Gentleware, No Magic,
Embedded Plus (SysML Toolkit for Rational Soft-
ware Development Platform), and others build their
tools on top of Eclipse technologies.
FROM UML TO ANSI-C - An Eclipse-based Code Generation Framework
13