5.2.3 Code generation
Code generation
works similarly to other generators described in the previous section. Depending
on the modeling language used and languages to be generated various constructs
can be produced automatically.
In MetaEdit+ code generators are predefined for
C++
, Smalltalk
, CORBA IDL,
Java
, and
Delphi
in the UML Class Diagram
and for SQL in Entity-Relationship models
. Descriptions
of each generator can be found from the comments at the start of that
generator’s definition.
Code generation is available from the Graph |
Generate... menu or the Generate toolbar command that are available
in all editors, as well as through the Generate... menu or
Generate Launcher toolbar button in Graph and Type Browsers when a graph
is selected. For example, to generate and compile Java code for the Watch
example:
| 1) | Choose
the ‘2008Models’ WatchFamily graph in the Graph
Browser. |
| 2) | Press
the Generate button in the Launcher toolbar. Alternatively, open the
pop-up menu with the right mouse button and select Generate....
|
| 3) | Select
‘Autobuild’ from the dialog that
appears. |
As a result of the selection Java
class definitions are written into files, compiled and executed in a web browser
as a testing environment.
In line with the other customizable metaCASE features of
MetaEdit+, code generation can be extended to cover other modeling and
programming languages. For more information about how to define generators, see
‘MetaEdit+ Workbench User’s
Guide’.