Table of Contents
This guide is designed to help you getting started with iQgen, innoQ's model driven software generator. If you have no idea what Model Driven Architecture is, we suggest you spend some time to read up on the topic on the Object Management Group's (OMG) website: http://www.omg.org/mda/ For the impatient developer, here is a short summary taken from the OMG's site:
The MDA is a new way of writing specifications and developing applications, based on a platform-independent model (PIM). A complete MDA specification consists of a definitive platform-independent base UML model, plus one or more platform-specific models (PSM) and interface definition sets, each describing how the base model is implemented on a different middleware platform. A complete MDA application consists of a definitive PIM, plus one or more PSMs and complete implementations, one on each platform that the application developer decides to support.
MDA development focuses first on the functionality and behavior of a distributed application or system, undistorted by idiosyncrasies of the technology or technologies in which it will be implemented. MDA divorces implementation details from business functions. Thus, it is not necessary to repeat the process of modeling an application or system's functionality and behavior each time a new technology (e.g., XML/SOAP) comes along. Other architectures are generally tied to a particular technology. With MDA, functionality and behavior are modeled once and only once. Mapping from a PIM through a PSM to the supported MDA platforms will be implemented by tools, easing the task of supporting new or different technologies.
To put this into context: Actually MDA is a successor to the model driven generative approach which has been around since the early nineties. In the mid-nineties, this generative approach failed partly due to the fact that code generators often had problems re-generating and merging artifacts. But that was only one reason for the artifacts of the development process to become inconsistent. The divergence of artifacts was a big problem, and still is. It has to be addressed carefully with an appropriate process.
The novelty of MDA, which makes it so powerful and promising, is the fact that there are well defined middleware standards like J2EE and CORBA. They and MDA together enable us to separate modeling concerns on the conceptual level rather than on a project or enterprise level. This means that there is a new chance for all of us to achieve long term technology independence and protection of investments. As mentioned by the OMG, tools are needed to support this process.
iQgen is one of these tools. With iQgen you can map your platform-independent model (PIM) to a platform-specific model, i.e. a model specific to a platform like .NET or J2EE.
Not surprisingly, you need to create the PIM somehow. The easiest way to do this is to use a CASE tool. Just create a model with one of the supported case tools and export it as an XMI file.
Your platform independent model is transformed to a platform specific model by means of a transformation, which is defined as a set of code generation templates.
In iQgen, there is no explicit PSM other than the code of your generated system. Conceptually, you can think of iQgen creating the PSM in a transient form. We have found this approach to work extremely well, although we consider adding model-to-model transformation to a future version of iQgen.
Once you have a PIM and at least one set of templates, you can simply hit iQgen's generate button and your application will be generated for a given platform. How well this works depends on the quality of both the PIM and the templates.
In order to successfully work with iQgen you need to understand how to specify your transformation, i.e. how to write templates. But before we delve into template creation, you should first get a better understanding of how code generation with iQgen works. This will be covered in the next section of this tutorial.