SlideShare a Scribd company logo
1 of 59
Acceleo
Code Generation
From the model
to the Android app
Stéphane Bégaudeau
stephane.begaudeau@obeo.fr
Mikaël Barbero
mikael.barbero@obeo.fr
Goals of the tutorial
Goals of the tutorialGoals of the tutorial
Beginners
See a simple
concrete
case-study
Acceleo
addicts
Discover
new killing
features
Android
experts
Learn
enough to
build
full-fledged
generator
I 'mI 'm notnot
an Androidan Android
development expertdevelopment expert
1.
Acceleo:
A new code generator
A long history
From Acceleo.org in 2006...
...to Eclipse.org in 2009
Version 3.0 is part of the
Eclipse Helios release train
A new codeA new code generation languagegeneration language
Metamodel and
templates based
technology
Implementation
of the Model To
Text OMG
standard (MTL)
Eclipse Modeling
/ M2T Project
Tooling to help
starting a new
generator from
scratch
The Acceleo SDK
Acceleo Runtime
(Compiler + Engine)
Acceleo
Development Tools
+=
Eclipse independant: can be
run anywhere (plain old Jar,
OSGi, Eclipse...)
2.
Prototype
based
approach
Warm-up
1. Launch the Eclipse
runtime
2. Switch to the
Acceleo perspective
3. Import the
handcrafted Android
application
Warm-up
1. Launch the Eclipse
runtime
2. Switch to the
Acceleo perspective
3. Import the
handcrafted Android
application
Put your hands dirty
Unlock the power of your models
Java UI Java DB
XML Properties
Different kinds of source
artifacts to be generated
One file to be generated...
...one MTL file to be created
Good Practice
A little bit of syntax
Header
A little bit of syntax
Body
The workflow file
The MTL file calling
the other ones
@main annotation
Initialize the generation project
1. Create new
Acceleo project
2. Use the wizard
(update file paths)
3. Create a
workflow file
Initialize the generation project
1. Create new
Acceleo project
2. Use the wizard
(update file paths)
3. Create a
workflow file
Put your hands dirty
3... 2... 1...
Launch
configuration
Anything
that can
launch Java...
Generated
Java Main
Stand
alone
Same
VM as
Eclipse
Standalone Standalone
Ignition
1. Launch the
generator
(launch config as Eclipse plugin)
2. Look @ the
traceability view
Ignition
1. Launch the
generator
(launch config as Eclipse plugin)
2. Look @ the
traceability view
Put your hands dirty
Quick replacement
Select a text section in the
template, then hit "Content
Assist" hotkeys
Quick replacement
Select a text section in the
template, then hit "Content
Assist" hotkeys
Put your hands dirty
Hierarchy Tree
Select a text section in the
template, then right-click
"Source > As For/If"
Hierarchy Tree
Select a text section in the
template, then right-click
"Source > As For/If"
Put your hands dirty
"As For/If" is quick but dirty...
...use templates
Good Practice
polymorphism instead!!
Generation patterns
Use the Generation
Patterns View
Generation patterns
Use the Generation
Patterns View
Put your hands dirty
Extract as
template
Select a text section in the
template, then right click
"Refactor > Extract as template"
Extract as
template
Select a text section in the
template, then right click
"Refactor > Extract as template"
Put your hands dirty
Refactoring
Alt + Shift + R
Refactoring
Alt + Shift + R
Put your hands dirty
3.
Make the Android App
run
Debug your templates
Thanks to Acceleo
debugger
Configure the
Android Development Kit
Create a new Android
Virtual Device - AVD
Set the path to the
SDK location
Turn on the phone
Turn on the phone
Put your hands dirty
4.
An generic Android App
generator
Create a fresh new model
Run the generator again
With a new Android
project as target folder
Generate new
Android Apps
Generate new
Generate new
Android Apps
Generate new
Put your hands dirty
5.
A new App
in a few
clicks
Packaging and deploying
Generate an Eclipse
UI plugin
Add an action on
right-click on models
Packaging settings
Filename pattern
of the model
Target folder of
the generation
Warning: Eclipse specific
Workout
1. Create new
Acceleo UI project
2. Use the wizard
3. Launch a 2nd
Eclipse Runtime
and test
Workout
1. Create new
Acceleo UI project
2. Use the wizard
3. Launch a 2nd
Eclipse Runtime
and test
Put your hands dirty
6.
Override specific behavior
Static
overriding
Dynamic
overriding
Overriding existing generators
Eclipse-only
Module B
Template
MT
Module A
Template
MT
Extends
overrides
Module C
Imports
C invokes MT, B.MT
will be executed
Overriding behavior
Protected area
Will not be erased
after re-generation
Dont forget the
comments marks...
... and the ID
Hands on
1. Statically override
previously defined
generators
2. Add protected area
in the body of
DBAdapter#updateNote()
Hands on
1. Statically override
previously defined
generators
2. Add protected area
in the body of
DBAdapter#updateNote()
Put your hands dirty
7.
The next step: Acceleo 3.1
Documentation
UI Improvements
(1) Brief history of Acceleo
(2) From an existing App to an App generator
(3) An App in a few clicks
(4) Advanced Acceleo features
(5) The next release
Thank you for your attention!
Questions?
CREDITS:
(c) Copyright Obeo, 2010
Photos (Creative Commons):
1. flickr/photos/laihiu/4407979507
2. flickr/photos/zachbonnell/5043454271
3. flickr/photos/mobergeron/130537193
4. flickr/photos/pictureperfectpose/76138988
5. flickr/photos/twid/410697715
7. flickr/photos/e2/2244075454
8. flickr/photos/17258892@N05/2588347668
9. flickr/photos/paperpariah/2417220138
10. flickr/photos/st3f4n/3975004250
11. flickr/photos/subcircle/500995147
12. flickr/photos/thetruthabout/2842830409
13. flickr/photos/enter/11960491
14. flickr/photos/enter/11960491
15. flickr/photos/wongdood/3379046643
16. flickr/photos/st3f4n/4106193567
17. flickr/photos/nasahqphoto/4109708805
18. flickr/photos/pcw/247087091
19. flickr/photos/purplemattfish/3020016417
20. flickr/photos/grungetextures/4213233972
21. flickr/photos/cococait/5016130987
22. flickr/photos/kh-67/3339157498
23. flickr/photos/carbonnyc/2965625438
24 .flickr/photos/7606551@N03/4917584222
25. flickr/photos/alain_limoges/4593736342
26. flickr/photos/knowprose/101872870
27. flickr/photos/john_dyer_jr/4764666803
28. flickr/photos/st3f4n/4408582299
29. http://www.android.com/media/
30. http://www.blogger.com
http://twitter.com/
http://www.fifa.com
http://www.openclipart.org
flickr/photos/schoffer/144670634
31. flickr/photos/loozrboy/4887231336
32. flickr/photos/st3f4n/4372885123
33. flickr/photos/darwinbell/316668966/
34. flickr/photos/edwbaker/4268008033
35. flickr/photos/wessexarchaeology/215904318
36. flickr/photos/st3f4n/4297940349
37. flickr/photos/koichiwb/4323277195
38. flickr/photos/merelymel/230291050
39. flickr/photos/st3f4n/4322352483
40. flickr/photos/gernot/2554175292
41. flickr/photos/st3f4n/4291462682
42. flickr/photos/40386452@N05/4487564062
43. flickr/photos/loty/326761635
44. flickr/photos/slowburn/2986303105
45. flickr/photos/82862943@N00/367490867
46. flickr/photos/stu_p/2317403942
Trademarks of brands and associated logos:
Android and Blogger are trademarks of Google, Inc.
Twitter is trademark of Twitter, Inc.
FIFA is trademark of FIFA

More Related Content

What's hot

Yet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile developmentYet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile development
Olivier Le Goaër
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01
Niit Care
 

What's hot (9)

Visual Studio Automation Object Model. EnvDTE interfaces
Visual Studio Automation Object Model. EnvDTE interfacesVisual Studio Automation Object Model. EnvDTE interfaces
Visual Studio Automation Object Model. EnvDTE interfaces
 
Yet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile developmentYet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile development
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01
 
Clarity in Documentation
Clarity in DocumentationClarity in Documentation
Clarity in Documentation
 
Intellij idea features
Intellij idea featuresIntellij idea features
Intellij idea features
 
Eclipse EDT - EGL Inner Workings - June 2011
Eclipse EDT - EGL Inner Workings - June 2011Eclipse EDT - EGL Inner Workings - June 2011
Eclipse EDT - EGL Inner Workings - June 2011
 
Eclipse Summit 2009 - Aspect Oriented Modeling
Eclipse Summit 2009 - Aspect Oriented ModelingEclipse Summit 2009 - Aspect Oriented Modeling
Eclipse Summit 2009 - Aspect Oriented Modeling
 
MDA Architecture - UML modeling Presentation
MDA Architecture - UML modeling PresentationMDA Architecture - UML modeling Presentation
MDA Architecture - UML modeling Presentation
 
Sikuli script
Sikuli scriptSikuli script
Sikuli script
 

Similar to Generating an Android App with Acceleo (Eclipse Summit Europe 2010)

Similar to Generating an Android App with Acceleo (Eclipse Summit Europe 2010) (20)

ID E's features
ID E's featuresID E's features
ID E's features
 
Compiling With Eclipse
Compiling With EclipseCompiling With Eclipse
Compiling With Eclipse
 
Notepad tutorial
Notepad tutorialNotepad tutorial
Notepad tutorial
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una Daly
 
Modeling With Eclipse @SoftShake 2011
Modeling With Eclipse @SoftShake 2011Modeling With Eclipse @SoftShake 2011
Modeling With Eclipse @SoftShake 2011
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in Unity
 
Effective Java
Effective JavaEffective Java
Effective Java
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptx
 
What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !
 
Is Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic GascIs Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic Gasc
 
Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)
 
Angular 2 Crash Course
Angular  2 Crash CourseAngular  2 Crash Course
Angular 2 Crash Course
 
Mia-Software at Eclipse Modeling Symposium 2010
Mia-Software at Eclipse Modeling Symposium 2010Mia-Software at Eclipse Modeling Symposium 2010
Mia-Software at Eclipse Modeling Symposium 2010
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascript
 
Getting started with PlatformIO
Getting started with PlatformIOGetting started with PlatformIO
Getting started with PlatformIO
 
EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1
 
Class 1 blog
Class 1 blogClass 1 blog
Class 1 blog
 

More from mikaelbarbero

Diff and Merge with Ease: EMF Compare
Diff and Merge with Ease: EMF CompareDiff and Merge with Ease: EMF Compare
Diff and Merge with Ease: EMF Compare
mikaelbarbero
 
OSGi: Don't let me be Misunderstood
OSGi: Don't let me be MisunderstoodOSGi: Don't let me be Misunderstood
OSGi: Don't let me be Misunderstood
mikaelbarbero
 
EMF.Edit the Force Unleashed!
EMF.Edit the Force Unleashed!EMF.Edit the Force Unleashed!
EMF.Edit the Force Unleashed!
mikaelbarbero
 
Google Guava & EMF @ GTUG Nantes
Google Guava & EMF @ GTUG NantesGoogle Guava & EMF @ GTUG Nantes
Google Guava & EMF @ GTUG Nantes
mikaelbarbero
 

More from mikaelbarbero (19)

Kubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating SystemKubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating System
 
Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
 
What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)
 
The Eclipse IDE: What's new in the 2017 release?
The Eclipse IDE: What's new in the 2017 release?The Eclipse IDE: What's new in the 2017 release?
The Eclipse IDE: What's new in the 2017 release?
 
What every Eclipse developer should know about progress reporting and job can...
What every Eclipse developer should know about progress reporting and job can...What every Eclipse developer should know about progress reporting and job can...
What every Eclipse developer should know about progress reporting and job can...
 
The Eclipse IDE - The Force Awakens (Devoxx France 2016)
The Eclipse IDE - The Force Awakens (Devoxx France 2016)The Eclipse IDE - The Force Awakens (Devoxx France 2016)
The Eclipse IDE - The Force Awakens (Devoxx France 2016)
 
Sirius: Graphical Editors for your DSLs
Sirius: Graphical Editors for your DSLsSirius: Graphical Editors for your DSLs
Sirius: Graphical Editors for your DSLs
 
Modeling in a Team Environment with EMF Compare and EGit
Modeling in a Team Environment with EMF Compare and EGitModeling in a Team Environment with EMF Compare and EGit
Modeling in a Team Environment with EMF Compare and EGit
 
Diff and Merge with Ease: EMF Compare
Diff and Merge with Ease: EMF CompareDiff and Merge with Ease: EMF Compare
Diff and Merge with Ease: EMF Compare
 
Eclipse simultaneous release in a nutshell
Eclipse simultaneous release in a nutshellEclipse simultaneous release in a nutshell
Eclipse simultaneous release in a nutshell
 
OSGi: Don't let me be Misunderstood
OSGi: Don't let me be MisunderstoodOSGi: Don't let me be Misunderstood
OSGi: Don't let me be Misunderstood
 
EMF.Edit the Force Unleashed!
EMF.Edit the Force Unleashed!EMF.Edit the Force Unleashed!
EMF.Edit the Force Unleashed!
 
EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)
 
EMFCompare 2.0: Scaling to Millions
EMFCompare 2.0: Scaling to MillionsEMFCompare 2.0: Scaling to Millions
EMFCompare 2.0: Scaling to Millions
 
3mf infinity-and-beyond
3mf infinity-and-beyond3mf infinity-and-beyond
3mf infinity-and-beyond
 
Eclipseconeurope 2011 - EMFCompare Improvements
Eclipseconeurope 2011 - EMFCompare ImprovementsEclipseconeurope 2011 - EMFCompare Improvements
Eclipseconeurope 2011 - EMFCompare Improvements
 
Google Guava & EMF @ GTUG Nantes
Google Guava & EMF @ GTUG NantesGoogle Guava & EMF @ GTUG Nantes
Google Guava & EMF @ GTUG Nantes
 
5M lines of code migration
5M lines of code migration5M lines of code migration
5M lines of code migration
 
EMFPath
EMFPathEMFPath
EMFPath
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Generating an Android App with Acceleo (Eclipse Summit Europe 2010)