HOME
UNTERNEHMEN
LEISTUNGEN
PRODUKTE
PROJEKTE
IQGEN
NEWS
KONTAKT
iQgen News
About iQgen
Whitepaper
Prerequisites
Download
Pricing & Licence
Services
Performance
User's Guide
Getting Started
FAQ
Resources

Frequently Asked Questions
What purpose is iQgen for? What can I do with it?

In short: iQgen is a tool which reads an XMI-based model file, loads a set of templates, and generates a set of files by applying the templates to the model. Please read the whitepaper for a more detailed of the tool and its approach.



What is XMI? Why does iQgen use it?

XMI is the XML Metamodel Interchange format defined by the OMG. While the latest version available is 1.2, most CASE tools only support version 1.0 and/or version 1.1. iQgen itself supports these two versions.

Using XMI as the integration interface between CASE tool and iQgen provides a loose coupling between them. To integrate based on the artifacts is an open, extensible and flexible way to do it. It ensures a long term productive use of the generative approach, independent from any specific product.



Why don't you directly integrate with CASE tools?

iQgen is still at the beginning of its life cycle. Our main focus is to get those things developers need everday to work bug free and efficiently. While we notice a possible productivity improvement due to a tighter integration between CASE tool and iQgen, we consider it to be of less importance. A future version is likely to include tighter integration with some, if not all, of the supported CASE tools.



May I use the bundled samples for my own business?

Yes, you are allowed to use the samples for any purpose you want. Nevertheless, you should be aware that they are intended as examples of how to build templates. What the sample templates generate does not fit to any real life application we met in our projects. So, from the licensing point of view, you are not hindered to use them. Think about the applicability.



Which mode is the more powerful one: batch or GUI?

You can use all of iQgen's features in both batch mode and GUI mode. What makes more sense for you depends on your application and the phase of the development cycle you're in. If you are constantly modelling and evaluating your result, you might want to use the generator interactively via the GUI, if only to gain the perfomance benefit of not having to load the JVM each time you generate. If you want to implement a daily or hourly build with full code generation, you might want to automate this via the batch interface.



Why do I need an Ant integration? Is the batch mode not fully functional?

Apart from the obvious reason that you might already have selected Ant as your build tool, another reason is that each start of the Java VM costs time. If you have to execute several generator runs during one batch, the usage of Ant reduces the overall time, because there is only one Java VM startup. But apart from that, the Ant integration is as powerful as batch or GUI mode.



Why is it impossible to run several instances of iQgen on one machine?

iQgen starts up an embedded standard servlet engine to ensure JSP compliance. Generator and servlet engine comunicate internally via sockets. Therefore a TCP/IP port has to be specified for the engine. If you attempt to start a second iQgen instance, you need to start it on a different port.



How can I solve this: com.innoq.generator.GeneratorException: Failed to start embedded web container.?

The most probable reason is that the port which iQgen wants to allocate by default is already in use. So changing the internal engine port to an unused value should solve your problem! You do this by editing the file iqgen_preferences.xml in your home directory.



How can I integrate iQgen in my environment, how can I customize it?

Currently, there are the documented configuration parameters for customization. An API is currently not availbale for extending the iQgen core itself. Every customization has to be done before or after code generation, or within the templates.



Does iQgen run on Linux, too?

Yes, it does. Due to its dependance to JDK/JRE 1.3.x it should be running on any Unix with a JDK 1.3 Java VM. Besides that, iQgen also runs on Windows NT, 2k, XP, and Mac OS X.



Where can I get iQgen's source code?

There are no plans to publish the sources for free (iQgen is not Open Source). If you are using iQgen in a project, feel free to contact us about pricing information or technology escrow possibilities.



What plans do you have with regards to templates for J2EE or .NET?

One of iQgen's main strengths is its independence of a particular technology. So while our own background is mostly Unix/C++/Java, you can use iQgen to generate whatever you like. A not even unlikely scenario is to generate COBOL code, J2EE components and COM frontends from a single model. It's your choice. We are likely to provide more samples templates in future releases.



How can I change the target generation path and file name for a file to generate, if I don't want to have all files in the same location?

In each template, you can specify the file name via a function called getFilename(). for example:

<%! public String getFilename()  {
        return getDirectory() + File.separator + MetaModel.getName(element)+ "Impl.java";
} %>



How can I generate a single file, which is constantly appended to (e.g. all classnames of a model)?

You cannot specify the same filename in multiple templates - the second template applied would merge the results with the existing file, which is most likely not what you want. You can generate information based on the complete model very easily though using the postProcessModel hook. Here is the simple example that list all classes in a model. First, you define two lists - CLASSES and INTERFACES - that you append to when the model is processed:

<%! public String[] getTemplates(MBase element)  {
    String name = getMetaModel().getName(element);
    if (getMetaModel().isClass(element)) {
            addToPart("CLASSES",element);
    } else if (getMetaModel().isInterface(element)) {
            addToPart("INTERFACES",element);
    }
%>

<%! public String[] getPostprocessTemplates()  {
        return new String[] {"class_list.jsp" };
}
%>

As you have registered class_list.jsp as the template to be executed during post-processing, you need to define it:

<%@ page import="java.util.Collection, 
                 ru.novsoft.uml.MBase, 
                 com.innoq.generator.StringHelper"
%>

<%     
    Collection classes = (Collection)request.getAttribute("CLASSES"); 
    Collection interfaces = (Collection)request.getAttribute("INTERFACES"); 
%>

<iqgen:foreach group="<%=classes.iterator()%>"  item="element" type="ru.novosoft.uml.MBase">
        <% String className = getMetaModel().getName(element); %>
        Class: <%= className %>    
</iqgen:foreach>

<iqgen:foreach group="<%=interfaces.iterator()%>"  item="element" type="ru.novosoft.uml.MBase">
        <% String interfaceName = getMetaModel().getName(element); %>
        Class: <%= interfaceName%>    
</iqgen:foreach>

<%! public String getFilename()  {
        return "ClassList.txt";
}
%>



How can I make iQgen check in/check out automatically?

There is no built-in support for configuration management. You could checkout the files before code generation, and check them in afterwards using scripts or via the Ant integration.



How can I access an arbitrary attribute (e.g. Tagged Value "ShortCut") of a referenced class within a template?

Please take a look on the API-documentation especially the MetaModelFacade. Furthermore the samples directory contains templates which show most of the necessary API calls.



What's up with the compiler-settings (they're often mentioned as the solution for any purpose...)?

To be done.



Where is the iQgen configuration stored?

All configuration data is stored in a file named iqgen_preferences.xml in your home directory.



What is my home directory on Windows NT/2k/XP? Which files are located there?

On Windows NT your user home directory is supposed to be in %WINDOWS-DIR%\Profiles\<username>\ - e.g.: C:\Windows\Profiles\phillip.

On Windows 2k and XP you can figure out the location of your user-home by typing echo %USERPROFILE% in a shell.

On Unix systems your home directory is - well, your home directory, e.g. /home/username or /export/home/username.



How can I pass my own configuration to the templates (e.g. environment-settings, XML-file...)?

There is currently no explicit option to do something like this. This is likely to change in a future release.



What's the runtime relation between iQgen's GUI and the generator backend?

In both cases, iQgen runs in a single Java Virtual Machine. To enable the use of standards conformant servlet engine, communication occurs using HTTP. Since this is done in-process, it is very efficient.



How can I write classes which can be used in my templates?

To be done.



Please explain all the subdirectories of an iQgen installation!

To be done.



How can I start iQgen in batch-mode (for automatic build and installation)?

The documentation covers that topic. A simple answer is: The same Java code archive contains both the GUI and the command line version. To start them, the call is thus very similar. While

java -jar iqgen.jar

will start iQgen in GUI mode, by specifying parameters you can have it do its work without ever opening a windows:

java -jar iqgen.jar -xmi=myModel.xmi -out=/home/src/mySource -jsp=/home/src/myTemplates -main=main.jsp



Do I have access to use case or interaction diagrams in my templates, or am I limited to class diagrams?

You can access everything that is in your model, as long as you know how to handle it. By default, iQgen will expect you to handle classes and interfaces (which can of course have special meaning due to their stereotype). If you want to generate code for other model elements, you need to override the method canBeGenerated in your main.jsp:

<%!
public boolean canBeGenerated(MBase pElem)  {
  return getMetaModel().isClass(pElem) || metaModel.isInterface(pElem)
           || getMetaModel().isXXX();
}
%>

where 'XXX' stands for the model element type you want to use.



Copyright © 2001-2003 innoQ. Alle Rechte vorbehalten. Rechtliche Hinweise