Top Banner
A Model Based Cross-Platform Code Generation Tool ROG ´ ERIO ARA ´ UJO COSTA University of Minho The problem of current software development stays on solutions portability for the rising number of platforms. Build abstract models is one efficient way to achieve this. The Model-Driven Software Engineering (MDSE) is one development methodology where models are the key for all project lifecycle, from requisites capture, through the modeling and developing stage, and still on testing. The goal of this article is to organize all the information about MDSE related word and state-of-the-art in order to support the development of a stand-alone tool able to prototype models to several platforms and to generate source code. The tool should allow flexible manipulation of models, especially on business rules definition. The innovation aspect of this tool will be the flexibility on creating complex business rules and well-defined usability proprieties, such as automatic or programmed execution, access control, and the release of personalized exceptions. The source code generated by the tool should reflect all the modeled aspects. Categories and Subject Descriptors: D.2.2 [Software Engineering]: Design Tools and Techniques; D.2.3 [Software Engineering]: Coding Tools and Techniques General Terms: Documentation, Algorithms Additional Key Words and Phrases: Model-Driven Software Engineering, Model Transformation, Cross-Platform Generation 1. INTRODUCTION The problem of current software development is the solutions portability for the rising number of platforms. Build abstract models is one efficient way to achieve this. Model-Driven Software Engineering is one development methodology that enables Platform Independent Models (PIM) creation, which can be derived on Platform Specific Models (PSM) for one or more platforms. Model-Driven Architecture (MDA), proposed by Object Management Group (OMG) in 2001, is one of the Model-Driven Development (MDD) techniques implemented by the most complex tools. To achieve the expected goal, it must be made a study in order to understand how a meta-model can be efficiently used to specify PIM models. Moreover, it has also become interesting to study the process of models transformation to produce PSM structures corresponding to the original PIM. To make it possible, it will be considered some accomplished attempts to define models transformation struts, such as direct model transformation or graph transformation approach. The purpose of this paper is to acquire a solid theoretical background in MDSE subject, specifi- cally on model based transformation structures and automatic source code generation. This study should enable a stand-alone tool development that will support PIM/PSM models with which we can prototype to several platforms and generate source code. The tool should allow flexible manipulation of models, specially on the business rules definition. The innovation aspect of this tool will be the flexibility on creating complex business rules and well-defined usability proprieties, such as automatic or programmed execution, access control, and the release of personalized exceptions. The source code generated by the tool should reflect all the modeled aspects. Therefore, this study aims to understand the advantages of MDSE and how meta-models should be parametrized to produce source code to well-defined target technologies such as Java or Android. This document is structured as follow: in section 2 it is exposed the need in create a tool for generating cross-platform code; section 3 presents the MDSE related work; in section 4 it is presented the state-of-the-art, more accurately, the prototypes and other solutions that have been developed for automatic cross-platform source code generation; in section 5 it is presented the tool Author’s address: [email protected] Departamento de Informtica, Universidade do Minho Master PreThesis Reports 2012 DI-RPD 2012, Pages 1–12.
12

A Model Based Cross-Platform Code Generation Tool

Oct 04, 2014

Download

Documents

Rogério Costa
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool

ROGERIO ARAUJO COSTA

University of Minho

The problem of current software development stays on solutions portability for the rising number of platforms.

Build abstract models is one efficient way to achieve this. The Model-Driven Software Engineering (MDSE) is one

development methodology where models are the key for all project lifecycle, from requisites capture, through themodeling and developing stage, and still on testing.

The goal of this article is to organize all the information about MDSE related word and state-of-the-art in order

to support the development of a stand-alone tool able to prototype models to several platforms and to generatesource code. The tool should allow flexible manipulation of models, especially on business rules definition. The

innovation aspect of this tool will be the flexibility on creating complex business rules and well-defined usability

proprieties, such as automatic or programmed execution, access control, and the release of personalized exceptions.The source code generated by the tool should reflect all the modeled aspects.

Categories and Subject Descriptors:

D.2.2 [Software Engineering]: Design Tools and Techniques;

D.2.3 [Software Engineering]: Coding Tools and Techniques

General Terms: Documentation, Algorithms

Additional Key Words and Phrases: Model-Driven Software Engineering, Model Transformation, Cross-Platform

Generation

1. INTRODUCTION

The problem of current software development is the solutions portability for the rising numberof platforms. Build abstract models is one efficient way to achieve this. Model-Driven SoftwareEngineering is one development methodology that enables Platform Independent Models (PIM)creation, which can be derived on Platform Specific Models (PSM) for one or more platforms.Model-Driven Architecture (MDA), proposed by Object Management Group (OMG) in 2001, isone of the Model-Driven Development (MDD) techniques implemented by the most complex tools.

To achieve the expected goal, it must be made a study in order to understand how a meta-modelcan be efficiently used to specify PIM models. Moreover, it has also become interesting to studythe process of models transformation to produce PSM structures corresponding to the originalPIM. To make it possible, it will be considered some accomplished attempts to define modelstransformation struts, such as direct model transformation or graph transformation approach.

The purpose of this paper is to acquire a solid theoretical background in MDSE subject, specifi-cally on model based transformation structures and automatic source code generation. This studyshould enable a stand-alone tool development that will support PIM/PSM models with which wecan prototype to several platforms and generate source code.

The tool should allow flexible manipulation of models, specially on the business rules definition.The innovation aspect of this tool will be the flexibility on creating complex business rules andwell-defined usability proprieties, such as automatic or programmed execution, access control, andthe release of personalized exceptions. The source code generated by the tool should reflect allthe modeled aspects.

Therefore, this study aims to understand the advantages of MDSE and how meta-models shouldbe parametrized to produce source code to well-defined target technologies such as Java or Android.

This document is structured as follow: in section 2 it is exposed the need in create a toolfor generating cross-platform code; section 3 presents the MDSE related work; in section 4 it ispresented the state-of-the-art, more accurately, the prototypes and other solutions that have beendeveloped for automatic cross-platform source code generation; in section 5 it is presented the tool

Author’s address: [email protected]

Departamento de Informtica, Universidade do Minho Master PreThesis Reports 2012

DI-RPD 2012, Pages 1–12.

Page 2: A Model Based Cross-Platform Code Generation Tool

2 · Rogerio Araujo Costa

draft and its validition; section 6 concludes the paper with some value added answers that willhelp the development of a Model Based Cross-Platform Code Generation Tool.

2. MOTIVATION

A software product visibility is due mostly to the number of platforms on which it operates. Writingportable code for multiple platforms is the more usual solution to achieve this result, as happenson writing browser-based/Java applications. Although it is not a perfect solution. Browser-basedapplications are resource limited, and not all platforms are able to run Java technology.

With new platforms emergence, such as Android, becomes as requirement for a software pac-kage this be written in various tecnologies. This concept is equivalent to the implementation ofseveral PSMs for a given PIM, representing thus a fairly cost plus for writing each of the applica-tions in various languages, in the maintenance of various configurations, and even have multipledevelopment teams qualified in various platforms.

The development of a tool able to interpret a conceptual design of a product and generate theimplementation for multiple platforms, since the effort to generate for N platforms is equal togenerate for one, is an attractive, if not required tool for any project manager. More specially ifthe aim is to promote the introduction of a new product in the market.

Next, there are some of the strongest points that a full-feature tool can provide:

(1) The time and effort to develop N implementations (N platforms and/or different settings)must get closer to develop a single implementation.

(2) Testing the same solution with different settings allow us to find faults, or some other kind ofproblem, which can only be visible in some configurations. This feature is profit that derivesdirectly from the previous functionality.

(3) With the emergence of new platforms and/or technologies, there is only the cost to upgradethe tool to generate code for that same novelty. Any solution that has been generated beforethe last version, can also be generated for the new features that the tool acquired later. Thus,the expandability of an application that has been built in the tool is granted along the time.

3. RELATED WORK

Before making any progress on defining blueprints for the proposed tool, it will be thoroughlyevaluated all prototypes and tools of model based code generation. Because methodologies andtechniques for software development started to appear since the first programming language, thereis a lot of work that can be used.

This section provides an introduction to MDSE paradigm and a MDA approach. Later, we willrely about models transformation definition and standards. It allows us to analyze more accuratelythe tools mentioned on the next section. The goal is to collect a full catalog of ideas, conceptsand successfully implemented guidelines, to empower the proposed tool.

3.1 MDSE

Model-Driven Software Engineering is a promising paradigm for complex software development.Models are the key for all project lifecycle, from requirements capture, through the modeling anddeveloping stage, and still on testing. In fact, this approach is based on a set of transformationsbetween successive models, from the most abstract to the most specific one, ending on a ready torun source code.

Model-Driven Architecture, proposed in 2001 by OMG group, is the MDSE most promisingapproach. It is a four stage process: Computational Independent Model (CIM), Platform Inde-pendent Model , Platform Specific Model, and source code. The transition between each stage isguaranteed by a model transformation set.

With a good set of transformations it is possible to achieve automatic models transformationand automatic code generation. This is exactly what we expect from a model based cross-platformcode generation tool. So, the supporting model structures and the set of models transformation arethe blueprints of any model based tool. What best defines the most useful blueprints is timesaving,and this makes them popular tools.

DI-RPD 2012.

Page 3: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool · 3

Next section is dedicated to Model-Driven Architecture, a practical realization of MDSE con-cepts.

3.2 MDA

MDA [Miller and Mukerji 2003][marie Favre 2004] is intended to support ever-changing businessenvironments, minimizing the software development time and project costs. MDA allow separa-ting the system functionality from implementation details, keeping consistent glue between bothsystems elements. It is a model-centric approach, where models are used for requirements capture,software development, testing and maintenance.

Software development based on MDA starts on high-level models in problem definition. Gradu-ally and automatically, image 1, the models are transformed into more specific models (low-level)until source code is reached. The transition between models can be achieved by a set of well-definedrules (the models glue), that can be of many types, depending on the pretended result.

There are four available types of models to provide different system architecture levels of abstrac-tion and independence: CIM, PIM, PSM, and source code. The CIM model reflects the businesscontext and the requirements of a problem.

In MDA lifecycle, the CIM is refined to PIM that specifies the behavior of the software compo-nents offered by the business logic layer. Later, the PSM for a specific platform (such as Linux,Windows or Mac OS) is extracted from the PIM model. The PSM adds to a model implementa-tion configurations of the target platform. A PIM model can be refined for many PSM models.Additionally, the source code is generated from the PSM model.

Fig. 1. MDA software development life cycle [Ribeiro 2008].

A MDA tool can functionally translate a model from one language to other languages. Forexample, a PIM model written in language x, could be translated to a PSM model written inlanguage y, using a tool that knows the f(x) = y function. So, it is possible to develop an abstractsoftware solution, which later can be translated to a real implementations, using a MDA tool anda set of f(x) = y functions. Then, there is no need to the developers to worry about how totransform a model.

In Gholami and Ramsin [2010] is described a concise analysis about strengths and weaknessesof MDA [Kleppe et al. 2003] [Mellor et al. 2004] [Frankel 2003]. MDA increases the productivity,because it permits that a developer mainly focus on abstract modeling (CIM and PIM), leavingcode tasks for the MDA tools. A PIM can be derived in one or more PSM, and then most ofthe software solutions can be ported for more than one platform, enhancing the cross-platforminteroperability. Also, an abstract model allows us to reuse any software solution for more thanone purpose, saving time on development because it uses already tested software artifacts.

DI-RPD 2012.

Page 4: A Model Based Cross-Platform Code Generation Tool

4 · Rogerio Araujo Costa

Fig. 2. Forward Transformations Fig. 3. Round Trip

There are some lacks identified in MDA, essentially related to model inconsistency and to toolsdependency. Model inconsistency increases how long the software solution becomes more complex,and it is used to more and more heterogeneous processes to extract low-level models.

When it is pretended different PSMs from the same PIM, the model inconsistency risk increa-ses. Since low-level models and implementation code are generated automatically, this approachrequires the right MDA tool.The tool needs to be qualified on models transformation, and to befull-feature for code generation.

The developer needs to know every action taken by the tool, but shouldn’t interact in mo-desl transformation process. If it is needed, the developer should be skeptical about the modelscompleteness, consistency, and about MDA tool capabilities.

MDA is supported by the MOF [OMG 2006], XMI [Xiao-mei et al. 2009], OCL [Clark andWarmer 2002], CWM [Group 2003] and SPEM [OMG 2006] OMG standards.

3.3 Forward Transformations and RoundTrip

There are mainly two Model-Driven Development [Mellor et al. 2003] mechanisms: forward trans-formations (image 2), and round tripping transformations (image 3).

In the forward transformations type, the process starts in the most abstract model (PIM), conti-nues to the specific models (PSM), and recursively ends on source code/text files. This mechanismis usually used when a solution is new, and so, there isn’t yet an implemented and proven solutionto be reused. If there is a new concept to be implemented on the problem domain, firstly thisshould be modeled on PIM and recursively, derivated to the specific models and implementationartifacts.

If the idea is to reuse some implemented business model, then it is necessary to use some roundtrip mechanism. This mechanism applies reverse engineering of transformations on implementedartifacts and can extract Platform Specific Models and, on a final stage, the PIM abstract model.

New features should be added to the extracted model and, on forward transformations fashion,the new implementation artifacts are generated. This technique is more complex than the first one,because the transformations that derived the source artifact are not always reversible. Despitethis fact, it is not a useless process; there are some good attending results that can reduce theeffort by 40%-50% in a 6 month development project [Akkiraju et al. 2009].

3.4 Transformation Approaches

There are mostly two types of models transformation [Czarnecki and Helsen 2003]: Model-2-Codeand Model-2-Model. The simplest approach is Model-2-Code and happens when the abstractmodel is directly translated to source code.

In the second case, the transformation runs from model to model, becoming more detailed accor-ding to the target: a source code; a more abstract model; a more specific model; or even a differentmodel at same abstraction level. In this document, we will focus on abstract to implementationmodels transformation.

There is one more type of models transformation, Code-2-Model. As we see in image 3, thereis the possibility to revert Model-2-Code transformations, extracting implementation models fromsource code. This operation is not perfect, because it is not possible to extract the original abstractmodel from source code, but still, is possible to achieve close enough results. This issue will not

DI-RPD 2012.

Page 5: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool · 5

be carried out further in this document, because it is not useful to the document objectives. And,this is a challenging issue, and requires more and more work around. See Couto [2011] for moredetails.

Next, it is considered the sub categorization for Model-2-Code and Model-2-Model transforma-tion types.

3.4.1 Model-2-Code. .In this subsection is presented the visitor-based transformations and later the template-based

transformations. Both approaches translates directly from models to source code, exactly as acode compiler do.

Visitor-Based Approaches. This is the simplest mechanism to generate source code from models.It’s a mechanism that visits the internal representation of a model and for each type of occurrencethe right artifact of source code is produced. Using Java taxonomy, this approach is similar torun out a collection by its iterator interface, outputting each result.

Template-Based Approaches. Actually, most tools support this type of model representationand its direct source code generation. To generate code, a tool scans the model and mixes eachelement of internal representation with the corresponding template. A template is a structure,usually text files, that holds static source code and meta-code to be replaced on the transformationprocess.

The concept of this technique is to separate the mechanisms of code generation from the struc-ture of the target source code. This allows each component to evolve separately. The templatescan also be defined only with examples, without know nothing about the source platform.

FreeMarker is a Java library, free and driven to the developer that produces source code bypredefined templates.

3.4.2 Model-2-Model. .In this subsection are categorized six Model-2-Model transformations types. In Model-2-Model,

transformations occurs from model to model, specifying the target platform model more andmore, until source code is generated. In fact, Model-2-Code transformations are the final step ofa Model-2-Model transformation sequence.

Direct-Manipulation Approaches. Usually supported by object-framework tools, this approachconsists of an internal model representation and an Application Programming Interface (API)to manipulate it. It is possible that the framework provides some minimal abstract structuretransformations behavior. So, the developer has to parameterize and to implement all the trans-formations rules, such as the scheduling priority between rules. Java Metadata Interface (JMI)[Sun Microsystems 2002] is one example of this approach.

Relational Approaches. Its concept consists in controlling the process of models transformation,by a set of well-defined rules. It seems very similar to Prolog’s inference engine. Easily, thelogic programming languages could use it, by defining the Predicate to describe relations, andtake-off advantage of unification based-matching, search and backtracking operations to complya full transformation process. Mercury, FMercury, F-Logic, and QVT [Gardner et al. 2003] areexamples.

Graph-Transformation-Based Approaches. Using graphs theory, this approach supports the mo-dels with a structured graph definition. It is a full-featured approach, but it is very complex tosupport, more specifically on transformations rules scheduling.

The idea is very simple. The graph has two main branches, the left branch LB and the rightRB, in which the left describes the structure of the original model and on the right one the targetmodel. When the LB matches with input model component, it is switched in place by RB.

VIATRA [Csertan et al. 2002], ATOM [ATOM ], GreAT [Agrawal et al. 2003], UMLX [Willink2003], and BOTL are the most known approaches that supports this type of transformations.

Structure-Driven Approaches. Similar to Direct-Manipulation, this approach also requires ma-nual definition of every transformation process. It is a biphasic task: first it requires building the

DI-RPD 2012.

Page 6: A Model Based Cross-Platform Code Generation Tool

6 · Rogerio Araujo Costa

hierarchical structure of a target model and then, on a second phase, attributes and referencesmight be parameterized on target model. The framework is responsible for managing the processof scheduling and transformation priorities.

Two well-known supporting tools for this approach are Optimal J and IOTP (base on QVTstandard).

Hybrid Approaches. There are a lot of initiatives that combine imperative and declarative con-cepts to define transformations. The rules are expressed and defined in a declarative way andare hardcode detailed in an imperative fashion. It isn’t required to detail imperatively all rules,in fact, this only should happen in specific cases. The languages Transformation Rule Language(TRL) [Alcatel et al. 2003] and Atlas Transformation Language (ATL) [Bezivin et al. 2003] followthis concept. ATL allows being setup to work full imperative, full declarative or the combinationof both. XDE [IBM ], no longer supported by IBM, is another initiative that fits in this category.Now, XDE is replaced by a full suite of modeling and developing tools, the Rational Rose productfamily.

Non-Categorized Approaches: XSLT [Consortium 2007] and CWM [Group 2003]. XSLT is a ge-neric models transformation approach and consists in the serialization of models in XML, usingfor that XML Metadata Interchange, or XMI. This is a heavy and complex approach and becomesunmanageable as the model grows, because of the XML verbosity. Still, it is XML and so theinteroperability is guaranteed. This allows the easy combination of transformation rules and, fora tool, XML it’s easy to manage. This approach is used by the open-source tool UML-QVT.

CWM, or Common Warehouse Metamodel, combines UML, MOF and XMI standards, to de-fine the linkage between the source model and the target model without specifying the targetmodel generation mechanisms. Using Java concepts is a kind of class interface. It is anothergeneric approach to define models transformation, and provides a four layered architecture forgeneral purpose of metadata manipulation. Some tools, as we will see in the next section, use thismechanism to take over the models transformation.

3.5 Summary

In this section we relied about MDSE paradigm and for what stands for. Was presented the MDAstrategy, proposed in 2001 by OMG group, and how efficiently it could support a Model BasedCode Generation Tool. More than that, it was exposed models transformation categorization, andfor each one, the advantages and the disadvantages of using them to support a tool.

This section allowed us to analyze more precisely the model based tools considered in the nextsection.

4. STATE-OF-THE-ART

In this section it will be analyzed the current cross-platform code generation prototypes and tools.We will give special attention to scientific material because this is continually evaluated by thecommunity, exposing all model-driven concerns and discussing about what should be improved.

MDSE isn’t a recent topic and so, there are already a lot of scientific material and tools applyingthe topic concepts. Java and Android are highly used technologies [TIOBE 2012][Kapetanakis2011], and we will take advantage of studying the topics concerning them first. Both are free,share the same developing language, and enable us to cover mobile, desktop, and web applications.Moreover, MDA tools and MDA architecture are correlated with Object-Oriented (OO) paradigm,and recursively Java language. Java also is easily adoptee because it is cross-platform betweenany architecture that runs Java Virtual Machine (JVM), and it allows building very powerful webapplications.

Android applications are easy to make available on Android Market [Finn 2011] and are sup-ported by a huge number of developers [Schuermans 2011]. So, it is expectable that the interestin this kind of the tool becomes likely by Android developers.

Next, there is an overview of five different cross-platform software development tools. Each nextsubsection corresponds to a tool, where is presented an overview about it, and summarily the keypoints and the drawbacks.

DI-RPD 2012.

Page 7: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool · 7

4.1 OutSystems Platform

More than a full-feature model based tool, OutSystems Platform [OutSystems 2011] is a huge setof tools for development, integration, and maintenance of web software. The development part ismainly codeless, optimized for an intuitive drag-and-drop modeling process, and allow generationof cross-platform code for standard .Net and Java languages. The platform brings a set of toolsand wizards that allow 3rd party systems integration. There are a lot of features targeted totrack the development process, such as the version control, and to track and support the runningdeployed solutions. For the analysis propose, we will only consider the development part.

Although there is a lot of technical info about the platform, it is very difficult to analyze theinternal platform structure. Applying the section two concepts, with some tool experiments, weclassify it for Model-2-Model type and forward transformations mode. More than that, it requiresa higher proximity level next to the tool developer.

The modeling environment is based in drag-and-drop features and it seems independent fromthe platform. It provides the necessary features to model business rules, user defined exceptions,user roles, database schemas and What You See Is What You Get (WYSIWIG) interfaces. Thecatalog of model fragments, saves a lot of modeling effort and applies the concept of reuse, oneof the best practices of software engineering. A generated solution can be ported for .Net(C# +ASP) and Java (Java + JSP) platform running over Oracle Data Base systems, or Microsoft SQLServer.

Key points. The first remarkable feature is the simplicity and high quality rendered interface.In fact, the high quality drag-and-drop interface helps a lot the codeless task and, so, the developeris more concerned about the modeled solution. The catalog with solutions fragments saves a lotof developing time, and implementation problems.

Drawbacks. Although the hosting on their own servers is a good market solution, it takes offthe control over the source code, unlike what happens in academic environment. The process ofdefining business rules isn’t so much flexile. Because it is a closed software product, the generatedsolutions portability is dependable from the OutSystems.

Competitors. Force.com, Windows Azure, Heroku and Google App Engine.

4.2 extMDA

Proposed and developed by Kun Ma and Bo Yang, extMDA [Ma and Yang 2010] can generatedeployable J2EE applications from UML Models. As we see, this is a Model-2-Model hybridapproach and it is designed for forward transformations process.

The idea is to model a system in any UML tool, defining the entities by a class diagramand business rules by an activity diagram. After, the interfaces, entities, POJO objects, JPAdefinitions, and data base schema, are generated by a full sequence of models transformation. Thedeveloper only needs to worry about the UML diagrams.

The tool interprets the UML model and generates the PIM model. Automatically adds sometrivial business rules (such as entity CRUD rules) beyond the ones defined by the user. After,using relational algebra theory, the PIM is translated to PSM, and it is composed by a CWM tablemodel, JAVA POJO objects, and the user interface definition. On final step, the PSM is derivedin J2EE source code and text files. To do that, is used the FreeMarker library, some developercustom JAVA classes, and a full set of templates.

extMDA comes with a good set of 3rd party development kits, such as JSF, Spring, Struts,Hibernate, iBATIS and Axis. This includes a tool kit to customize and create new toolkits for thetool.

Key points. Adopts standard UML and requires low-level of UML knowledge. It has the capa-bility of 3rd party development kits integration.

Drawbacks. The tool generates code for one specific platform. The interfaces can’t be efficientlymodeled. It lacks of modeling features, such as, personalized exceptions, integration of externalAPIs and definition of user roles.

Competitors. Andro MDA, Optimal J, openMDX, UMT-QVT, FUJABA and MDE.

DI-RPD 2012.

Page 8: A Model Based Cross-Platform Code Generation Tool

8 · Rogerio Araujo Costa

Fig. 4. l OdinTools Model Hierarchy [Meads and Warren 2011]

4.3 OdinTools

Odin [Meads and Warren 2011] is a middleware to developing mobile services for iOS and Androidplatforms. This provides an easy way to develop complex mobile services, without concerningabout physical specifications from the mobile device and hardware components, such as, GPSreceiver or Bluetooth hardware. Odin framework is the upgraded version of Odin middlewarewhich allows cross-platform portability.

Both, Odin middleware and Odin framework are supported by a Model-Driven Architecture.In fact, Odin framework is the top layer software of Odin middleware. This prototype was beenimplemented using Marama tool set [Meads and Warren 2011] Eclipse plug-in. Marama supportsmulti-view and multi-user diagram modeling features, exposing a meta-model structure acrossend-user accessible tools.

Odin is a Model-2-Model and forward transformations tool as it is visible on 4. The ServiceModel was built using the plugin Marama that supports all user modulation concerts, in Service-Oriented Architecture (SOA) fashion. This model is translated in mobile business logic, supportedby Odin framework. OM layer is needed to link the developer model with Odin middleware.

The final two layers are standard in any MDA. In this case the PIM layer supports all middlewaredefinitions for platform portability and the PSM translate them for the chosen platforms.

Key points. The prototype is a plugin for a powerful IDE, Eclipse, and supports full platformmodeling independence. It also provides some common domain solutions to be used and custo-mized. Drag-and-Drop modeling features are also attractive and make the developer task highlycodeless. For specific situations, the developer can make customized code in SQL-like bindingsyntax. The mobile services offered by the tool and supported by Odin middleware, make thisprototype ground-breaking in SOA area.

Drawbacks. Odin Tool is a recent prototype and doesn’t support user interface modelation. So,it needs to be done by hand in a XML. The tool was only developed to generate code for Androidplatforms and so, it isn’t a fully cross-platform code generation tool.

Competitors. Titanium Developer, Open-Plug ELIPS, XMLVM and Unimod.

4.4 IBM Rational Software Architect

Rational Software Architect (RSA) is a UML modeling environment designed for developing C++and J2EE applications, and web services. Built over Eclipse framework, this tool is headed formodel-driven development and code analysis, allowing both types of models transformation.

This is a Model-2-Code tool and, in a forward transformations fashion, it allows generationof C++, C#, Java, EBJ, WSDL, XSD, CORBA IDL and SQL logical database schemas fromUML models. The inverse operation permits extracting UML models from Java, C++ and .Netimplementation artifacts/source code.

DI-RPD 2012.

Page 9: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool · 9

Beyond these technical features, the tool is compatible with other IBM products, such as Ratio-nal Application Developer (RAD), and offers multi-user development, controlling each concurrentlydeveloper task.

The modeling environment is almost codeless, supports customizable UML 2.2, offers designtools and a full set of brand new IDE features, such as search engines, wizards to save time onconsuming tasks, plugins, code generation pattern driven tools and automatic code correction.

RSA was design to be a very productive tool, integrating a lot of IBM lifecycle tools, such asInfoSphere Data Architect, Rational Team Concert, Rational Requirements Composer and moreother IBM solutions.

Key points. The tool allows both orientations of models transformation. Round trip supportsaves a lot of time when some solution can be reused. The full integration of UML 2.3 in themodeling environment appeals to sympathy of developers, team leaders and stakeholders. A largenumber of target platforms and technologies, and the drag-and-drop modeling feature, are verygood requirements and make the tool practical for any major project. In fact, it comes withmulti-user development environment.

Drawbacks. The process of code generation is Model-2-Code, and loses the advantages of theapproach Model-2-Model. It needs high hardware requirements for each developing tool instance.

Competitors. Objecteering and Arcstyler.

4.5 Optimal J

Optimal J, like RSA, is built over eclipse framework and generates source code from UML models.There is one main difference between them: Optimal J only supports code generation for J2EEenvironment.

Unlike the other tools, this is a practical implementation of MDA concepts and OMG standards.It follows a structured approach for models transformation, first PIM, then PSMs and finally sourcecode. It is a pattern-driven solution and provides active synchronization between models and code.Any change on one component reflects automatically on other.

Optimal J can deploy automatically to most J2EE servers, such as IBM WebSphere and iPlanetApplication Server, and also offers a local deploy feature for developer tests. Optimal J becomeswith drag-and-drop features for UML modeling, domain and business rules definition, and forGraphical User Interface (GUI) design. It also offers wizards for many configurations, like databaseconnections.

Key points. Optimal J implements MDA standards proposed by OMG; It is a pattern-drivensolution, and supports active synchronization between source code and models. It supports CASE-tools models, specifically UML.

Drawbacks. Optimal J is a discontinued product since the release of Compuware 2.0 [O’Garaet al. 2001]. It only generates source code for J2EE environment.

Competitors. Same as extMDA.

4.6 Summary

In this section it was exposed a global overview of MDA tools. From open source to ownerproperty, from full OMG’s MDA implementation to other approaches, and from stand-alone toclouding tools. It was chosen one tool from each ends, explaining the concept and the features,the most valued points (key points), the worst (drawbacks), and some competitors.

Counting MDA tools, case tools, and other productivity plugins, it was isolated a list with morethan 100 references, exposing the most significant for this case of study. Although there are a lotof references, increasingly this tools are being discontinued, and only huge platforms such as RSAstill being more used.

5. A TOOL FOR CROSS-PLATFORM CODE GENERATION

The purpose of the dissertation is to develop a prototype framework that supports academic studyand research, minimizing the lack between MDSE theory and the real use of them. From MDA

DI-RPD 2012.

Page 10: A Model Based Cross-Platform Code Generation Tool

10 · Rogerio Araujo Costa

Fig. 5. Overview of tool architecture

theory to MDA tools, we approach some important points and concerns, allowing us to state thefundamental guidelines for develop the proposed tool.

The main objective is to build a stand-alone tool for a model based cross-platform code gene-ration strategy. Specifically, it must rely in Model-2-Model transformations and forward transfor-mations. The tool should have from scratch both, Java and Android, transformations. The toolshould also present high usability principles and favor codeless tasks. Is expected a good renderedinterface, wizards for the most non-modeling tasks, and a catalog with some business MDA blocksavailable to be used/reused.

Image 5 is the logic architecture of the tool. There are three main components identified: ObjectComposer, Persistence File, and Object Interpreter and Code Generator Engine. Despite the threecomponents are integrated in the tool, they need to be so modular that will allow independentoperations.

Object Composer is responsible for holding the visual environment that manages the modelelements. This includes entities manipulation, business rules, GUIs, and other model elements.This should present a codeless design environment, with good usability principles.

Persistence File is the mechanism responsible to support model persistence. We can considerXMI standard for this purpose, but ideally, this mechanism should support more than one format.

Object Interpreter and Code Generator Engine compose the tool core. They are responsible forholding the models definition, for the models transformation, and for the source code generationand all related operations. The process of code generation might be pattern-driven, with loggingof each transformation, and be accomplished with the right source code documentation.

In the tool draft are considered three main output targets: Web applications, Hybrid clients,commonly known as ”Fat Clients”, and Desktop. The considered Java platform resides in Desktopcategory, and Android in Hybrid category.

Since it is a model based tool, there are a lot of software engineering concerns that could beapplied to the tool. First we can consider the implementation of model checking and testing, andlater, enable it for supporting real-time solution development. The tool could be empowered alsoby productivity plugins, such as, team management support, version control, and a manager totrace the deployed solutions. In fact, each topic mentioned before is a challenging dissertation.

Key features. The prototype framework is a stand-alone tool, with rich GUI, and with codelessflavor for software development. Adopting an academic style, it will be design to be used and

DI-RPD 2012.

Page 11: A Model Based Cross-Platform Code Generation Tool

A Model Based Cross-Platform Code Generation Tool · 11

maintained by other academic studies. It must support Model-2-Model transformations, for Javaand Android specific Java patterns, logging each model transformation, and should be pattern-driven in code generation. The generated code must be readable and accompanied with therespective documentation.

6. CONCLUSION

This document presented a set of software development tools and the portability issues for thecurrent number of platforms, specifically how to develop a model based cross-platform code gene-ration tool. We concluded that throught MDSE concepts is possible to build abstract models thatprovide portability for a software solution. It supports Platform Independent Models which canbe derived in Platform Specific Models for one or more target platforms, such as Java or Android.

The workaround about the model-driven tools prove that there are many ways to achieve sourcecode portability, but with different preconditions and side effects. There is a tradeoff betweenModel-2-Code and Model-2-Model transformations. Mode-2-Code transformations are simpler touse, and less complex. On the other hand, Model-2-Model transformations are more modular, allowreuse of implementation artifacts for various platforms, and support better the models complexity.Round tripping operations are a value-add feature, allowing the tool to be able to keep up as thesolution scales. For example, in IBM Web Sphere case study [Akkiraju et al. 2009], with reuse ofthe implemented solutions, they save 40%-50% of development enforce in 6 month project.

Features such as wizards for non-modeling tasks, or codeless and good looking GUI, are theassets to convince any developer. Looking closer, many MDA tools lacks in the definition ofcomplex business rules, and full automation in source code generation. From scratch only Javaand Android will be available for code generation, but the tool will be plugin-driven so that laterit may support more platforms. The core of this work is to abstract the blueprints for all toolmechanisms.

In MDSE domain, there are a lot of scientific work and open source/commercial tools based onits concepts. Looking closer, Pass tools such as OutSystems, or IBM Rational, are supported byMDSE concepts. Analyzing the current non-outdated tools and the current software developmentneeds, there is a viable space for a brand new tool, specially if it resolves the previous faults ofMDA tools. Moreover, this initiative has been weighted by the nucleus of software engineering ofUniversity of Minho, where doesn’t exist such academic tool. Surely it will please many studentsand will be used for other academic studies.

REFERENCES

Agrawal, A., Karsai, G., and Shi, F. 2003. A uml-based graph transformation approach for implementing

domain-specific model transformations. In International Journal on Software and Systems Modeling.

Akkiraju, R., Mitra, T., Ghosh, N., Saha, D., Thulasiram, U., and Chakraborthy, S. 2009. Toward the

development of cross-platform business applications via model-driven transformations. In Services - I, 2009World Conference on. 585 –592.

Alcatel, Softeam, Thales, and TNI-Valiosys. 2003. Response to the mof 2.0 query/views/transformations rfp(ad/2003-04-10). Misc.

ATOM. A tool for multi-paradigm modeling. http://atom3.cs.mcgill.ca/.

Bezivin, J., Dupe, G., Jouault, F., Pitette, G., and Rougui, J. E. 2003. First experiments with the atl model

transformation language: Transforming xslt into xquery. In 2nd OOPSLA Workshop on Generative Techniquesin the context of Model Driven Architecture.

Brown, A. 2008. Mda redux: Practical realization of model driven architecture. In Composition-Based Software

Systems, 2008. ICCBSS 2008. Seventh International Conference on. 174 –183.

Cheng, F. 2010. Mda implementation based on patterns and action semantics. In Information and Computing

(ICIC), 2010 Third International Conference on. Vol. 2. 25 –28.

Clark, T. and Warmer, J., Eds. 2002. Object Modeling with the OCL, The Rationale behind the Object Constraint

Language. Lecture Notes in Computer Science, vol. 2263. Springer.

Consortium, W. W. W. 2007. Xsl transformations (xslt) version 2.0. http://www.w3.org/TR/2007/

REC-xslt20-20070123/.

Couto, R. 2011. Inferencia de PSM/PIM e padroes de concepcao a partir de codigo Java. M.S. thesis, Universityof Minho, Portugal.

DI-RPD 2012.

Page 12: A Model Based Cross-Platform Code Generation Tool

12 · Rogerio Araujo Costa

Csertan, G., Huszerl, G., Majzik, I., Pap, Z., Pataricza, A., and Varro, D. 2002. Viatra - visual automated

transformations for formal verification and validation of uml models. In Automated Software Engineering, 2002.Proceedings. ASE 2002. 17th IEEE International Conference on. 267 – 270.

Czarnecki, K. and Helsen, S. 2003. Classification of model transformation approaches. In OOPSLA’03 Workshop

on Generative Techniques in the Context of Model-Driven Architecture.

Finn, W. 2011. Android market vs iphone app store. http://www.brighthub.com/mobile/google-android/

articles/74976.aspx.

Frankel, D. S. 2003. Model Driven Architecture: Applying MDA to Enterprise Computing. John Wiley & Sons.

Gardner, T., Griffin, C., Koehler, J., and Hauser, R. 2003. A review of omg mof 2.0query / views / trans-

formations submissions and recommendations towards the final standard.

Gholami, M. F. and Ramsin, R. 2010. Strategies for improving mda-based development processes. In Proceedingsof the 2010 International Conference on Intelligent Systems, Modelling and Simulation. ISMS ’10. 152–157.

Group, O. M. 2003. The common warehouse model 1.1.

IBM. Rational xde. Misc.

Jilani, A., Usman, M., and Halim, Z. 2010. Model transformations in model driven architecture. In Universal

Journal of Computer Science and Engineering Technology. 50–54.

Kapetanakis, M. 2011. Developer economics 2011 – winners and losers in the platform race. http://www.

visionmobile.com/blog/2011/06/developer-economics-2011-winners-and-losers-in-the-platform-race.

Kleppe, A. G., Warmer, J., and Bast, W. 2003. MDA Explained: The Model Driven Architecture: Practice and

Promise. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.

Lind, J. 2011. Platform x: How cross-platform tools can end the os wars. http://www.visionmobile.com/blog/

2011/06/platform-x-how-cross-platform-tools-can-end-the-os-wars/.

Ma, K. and Yang, B. 2010. A hybrid model transformation approach based on j2ee platform. In Education

Technology and Computer Science (ETCS), 2010 Second International Workshop on. Vol. 3. 161 –164.

marie Favre, J. 2004. Towards a basic theory to model model driven engineering. In In Workshop on SoftwareModel Engineering, WISME 2004, joint event with UML2004.

Meads, A. and Warren, I. 2011. Odintools–model-driven development of intelligent mobile services. In Services

Computing (SCC), 2011 IEEE International Conference on. 448 –455.

Mellor, S., Clark, A., and Futagami, T. 2003. Model-driven development - guest editor’s introduction. Software,

IEEE 20, 5 (sept.-oct.), 14 – 18.

Mellor, S. J., Scott, K., Uhl, A., and Weise, D. 2004. MDA Distilled: Principles of Model-Driven Architecture.

The Addison-Wesley Object Technology Series. Addison-Wesley.

Miller, J. and Mukerji, J. 2003. Mda guide version 1.0.1. Tech. rep., Object Management Group (OMG).

Monsieur, G., Snoeck, M., Haesen, R., and Lemahieu, W. 2006. PIM to PSM transformations for an event

driven architecture in an educational tool. In Proceedings of the European Workshop on Milestones, Models andMappings for Model-Driven Architecture (3M4MDA 2006) at ECMDA 2006. 49–64.

O’Gara, M., Issam, L., Hunt, C., John, B., and Rossman, G. 2001. Compuware corporation’s optimal j. http:

//java.sys-con.com/node/36300.

OMG. 2006. Meta Object Facility (MOF) Core Specification Version 2.0.

OMG. 2006. Software process engineering metamodell spem 2.0 omg draft adopted specification. Tech. rep.

OutSystems. 2011. It resources. http://www.outsystems.com/it-resources/.

Ribeiro, A. N. 2008. Um processo de modelacao de sistemas software com integracao de especificacoes rigorosas.

Ph.D. thesis, University of Minho.

Schuermans, S. 2011. The flywheel effect of android and ios (and why their

rivals are grinding to a halt). http://www.visionmobile.com/blog/2011/09/

the-flywheel-effect-of-android-and-ios-and-why-their-rivals-are-grinding-to-a-halt/.

Singh, Y. and Sood, M. 2009. Model driven architecture: A perspective. In Advance Computing Conference,2009. IACC 2009. IEEE International. 1644 –1652.

Sun Microsystems. 2002. Java metadata interface.

TIOBE. 2012. Tiobe programming community index for january 2012. http://www.tiobe.com/index.php/

content/paperinfo/tpci/index.html.

Willink, E. D. 2003. E.d.willink umlx: A graphical transformation language for mda umlx: A graphical transfor-mation language for mda.

Xiao-mei, Y., Ping, G., and Heng, D. 2009. Mapping approach for model transformation of mda based on xmi/xmlplatform. In Education Technology and Computer Science, 2009. ETCS ’09. First International Workshop on.

Vol. 2. 1016 –1019.

DI-RPD 2012.