Previous Next Title Page Contents


The goal of this example is to demonstrate the features and implementation of a domain-specific modeling environment to the reader. The example will cover the issues of designing and implementing the modeling language, building tool support for it (including 100% code generation), working with it and finally extending it. Please note that certain parts of the example may require working hands-on to ensure the best understanding of the subject matter.

To explore the Watch example thoroughly, you must have installed the following:
Java Platform, Standard Edition Development Kit (JDK) for compiling the Java code produced by the example code generator. At the time of writing, the latest version is JDK 6 Update 4 and it is the version we have tested the Watch example with. Optional features presented in Chapters 4 (support for MIDP platform) and 5 (the use of MetaEdit+ API) require the installation of additional components – for more information about them, see their respective chapters.

 The JDK for Windows and Linux can be downloaded from For Windows we recommend the default installation options suggested by the installer. On Linux we recommend the installation on /usr/local/jdk1.6.0_04. On Linux you must also manually register the Java Runtime Environment (JRE) plug-in for the web browser you are going to use to execute the generated code in. Instructions for this can be found at
 If you are installing the JDK somewhere else than in default or recommended directories or you are using another version than JDK 6 update 4, you have to change the code generator path definitions. Open the Generator Editor for ‘2008Models’ graph, locate the generator script called ‘__JavaPaths’ and edit the values of path variables to point to the correct directories ($winJDK for windows and $linuxJDK for Linux, respectively). Alternatively, you could compile and execute the code manually, or set appropriate symbolic links.
 In the Mac OS X platform, which is shipped with pre-installed JDK, we use and comply with its standard installation. If you need to change this, edit the value of path variable $macJDK in ‘__JavaPaths’ generator script. Additional changes to the ‘_create make for Mac OS X’ generator script may be required also.
A web browser with Java support.
MetaEdit+ Workbench for trying out the extensions presented in Section 2.5. The hands-on examples in Chapter 5 require either MetaEdit+ Workbench or MetaEdit+ with API support. The rest of the example can be explored with any version of MetaEdit+.

For further information about MetaEdit+ please refer to the ‘MetaEdit+ User’s Guide’, ‘MetaEdit+ Workbench User’s Guide’ or our web pages at

Previous Next Title Page Contents