Java2Flex

Java2Flex is a source code generator for Flex MVC architectures based on Cairngorm or PureMVC. This solution has been created by Kap IT, Flex company since 2004, in partnership with Mia-Software.

Overview

This solution is designed to help you streamline Flex/J2EE Enterprise Application development. It will handle the plumbing of your Java/Flex business applications and will help you to focus on the development of business core.

 

Java2Flex takes just a few seconds to generate a full complement of classes, such as Command and Event, that are required by MVC architectures. Whatever the size of your application, you immediately get a ready-to-use Flex library that you can use to call remote objects on a BlazeDS or LCDS server. The time savings compared to hand-coding can be enormous.

Architecture of the solution

The generator is an Eclipse plugin. It is available as a stand-alone product through a dedicated distribution with samples and all the required plugins. It allows you to generate Flex source code from a Java project loaded in the Generator workspace.

 

With the current version of Java2Flex it is possible to generate code for two different frameworks: PureMVC and Cairgorn. Besides, thanks to a flexible architecture, generators are not hardcoded at all: the way the Flex code is generated can be tailored to other patterns or other frameworks.

 

The generation is decomposed in three phases:

 

    1. Analysis of the Java project and its corresponding BlazeDS configuration file. Two models (one for the Java classes and one for the configuration file) are created to provide a comprehensive description of the existing project for which the Flex code has to be generated.
    2. From these two “technical” models, the information required to generate the Flex code is extracted to populate a new model: the exposed services (name, superclass, implemented interfaces, …) , their exposed operations (name, signature) and the objects used by these operations (name, structure, superclass, …).
    3. Then from this minimal model, templates are applied to generate the Flex files.

 

These three phases are implemented with three tools based on the Eclipse Modeling Framework (EMF).

 

    1. MoDisco, provides open-source components to create EMF models from existing source code. Java2Flex uses the Java and XML MoDisco components, developed by Mia-Software, to create models from a Java project and from the BlazeDS configuration file.
    2. Mia-Transformation is used by Java2Flex to create the model of the services from discovery rules applied on the Java and the XML models.
    3. Finally, Mia-Generation is used to apply code generation templates to produce the Flex code.

 

These tools are controlled by Java2Flex as an eclipse plugin.

Try it !

Java2Flex evaluation version, screencasts and complete documentation are available from the KapIT lab.