Acceleo - Let's start with an Android example
-
Upload
jonathan-musset -
Category
Technology
-
view
9.219 -
download
10
description
Transcript of Acceleo - Let's start with an Android example
1
Jonathan Musset - [email protected]
Acceleo Code Generation
Obeo
Let's start with an Android example
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Acceleo : what's that new code generation engine?
Meta-model and templates based technology
Implementation of the Model To Text OMG standard (MTL)
Eclipse Modelling / M2T project
Pragmatic approach – How to start from example?
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
This is a Quick Tutorial – My goals
Beginners will see a simple but concrete case-study
Acceleo addicts will discover some new killing features
Android experts will learn enough of the basics to be able to create advanced code generator in a few days. As you will see, I'm not an Android expert...
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Prototype based approach – Starting from an example
A classic example of Android application : « MyContacts »
« We would like to be able to fully generate the same kind of application »
MyContacts
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
The prototype sources and the model
Different kinds of sources to be generated!Java UI, Java DB, XML, properties...
The model must contain all the specific settings of the applicationAndroid Activity, Entity Fields...
One model element « N » generated text parts→
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Initialize the Android code generation project
An MTL file for each kind of generated file
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Initialize the workflow – The main entry point
An MTL file that calls the other ones... (Mentioned in the OMG specification)
Java / MWE / ANT? Call the Java Standalone API to run the code generation!
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Editing the code generator – Quick replacement
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Editing the code generator – Quick hierarchy tree
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Run and test the generated version of the prototype
MyContacts
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Run on other models to create new applications...
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
A little bit about incremental generation
« My web service is conserved when I generate the application again »
→ Defining specific coding zones with user tags [protected]
→ Using JMerge with the @generated annotation
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Workbench Acceleo views – Edit and maintain!
The « Result View » to show how the text and the model are synchronized
The « Overrides View » to override an existing template behavior
The « Patterns View » to define your own completion proposal
© Copyright Obeo | 22 March, 2010
Let's start with an Android exampleAcceleo Code Generation
Conclusion
Now you can make a complete Android code generator (more widgets...)
We plan to have Acceleo graduate along with the Helios release
Version 3.0 – The last stable release out of Eclipse was 2.x
15
Jonathan Musset - [email protected]
Acceleo Code Generation
Obeo
Let's start with an Android example