Wednesday, March 24, 2010

Eclipse Con 2010 and Acceleo community feedbacks


Eclipse Con seems to be a great success this year, like every year ;-)

I have particularly liked the Jeff Norris keynote this morning. What a standing ovation! Thank you Jeff for the road trip on mars...

Thanks also to you Kenn for the nice Eclipse Modeling Runaway 2010. It was a pleasure to talk a little bit about Acceleo. For those of you who are interested, here is the fash demo I have shown during this session : Acceleo at Eclipse Modeling Runaway 2010.

Here are the slides of my 25 minutes session Acceleo Code Generation - Let's start with an Android example. I hope that you liked it... Let's me know if you have learned something. I had 3 goals when I made this quick tutorial :

  • Acceleo beginners could see a simple but concrete case-study
  • Acceleo addicts could discover some new "killing" features, for the Obeo guys also ;-)
  • Android experts could learn enough of the basics to be able to create advanced code generator in a few days

I'm not an Android expert but I like this technology and I have liked to make a quick example on how to use Android and Acceleo together. To be continued...

Monday, March 8, 2010

Just a little bit about "Simple OCL"

I just come back from Cambodia, and it has been a wonderful time to think about how to simplify modeling technologies ;-) ;-) I have focused on the language we use everytime to make automation tools with modeling technologies : OCL

The OCL OMG specification has been released several times in the last 5 years. We use OCL at Obeo to make automation tools with Acceleo and ATL, and we think that OCL queries should be as short as possible to improve the template readability... We have defined several common OCL queries that are always used in our tools. We would like to have these queries in the standard library because we must define them each time we have to make a new tool with Eclipse modeling technologies.

Here are some ways to simplify OCL I have discussed a couple of days ago with OCL experts. It isn't really easy to think about how to improve OCL because there were a lot of work on it and we can't change everything for compatibility reason. But, it is really possible to improve the language with little thing without breaking the compatibility.

The first way for me to improve OCL is to add in the library the common stuff we define every time in our code generation and model transformation projects. When we navigate on models, the main things we do is to navigate around the current node, up and down : to get the children, the children of the children, the parent, and the siblings... OCL should propose shortcuts to go in these directions... Do we need a new function in the library or a new syntax element like in XPath? I don't know, but both will be better than what we have today. We often need to filter the types of the objects we would like to keep during this navigation. We spend a lot of time to explain how to get some specific children of the current node. As an example, here is the expression we have to write in OCL to get the descendant list of an object where we only want to keep the named elements :
myCollection->select(oclIsKindOf(NamedElement))-> collect(oclAsType(NamedElement))


It would be strictly equivalent to eAllContents(NamedElement) if the query eAllContents(OclType) was defined. Of course, we can define this query in one common library for all the projects of my company. I'd prefer to have such a useful service in the OCL standard library to prevent naming ambiguities. Today, everybody gives its prefered name to this query and it isn't possible to understand easily the work of someone else.

For the same reason, we would like to simplify the syntax used to make filters on collections. myCollection->select(name <> ' ') could be replaced by myCollection[name <> 0]. The "select" function is used everywhere in OCL queries. This new shorter syntax could really improve readability. To be extreme, [...] should be the way to filter every kind of thing, for example if I want to filter the types of the objects in the current collection, I would write something like that :
myCollection[Class].name

myCollection[Class or Interface].name

In the second example, "name" could compile because there is a common attribute called "name" both in "Class" and "Interface". The goal is to replace the oclAsType() function as often as possible.

Another way to improve the readability of the OCL expressions is to add operators like '+' or '-' between collections :
(property + method)->size()
(list - element)->size()
list + element

Some researchers think that we can already do that with operator overloading, but to go further, we would probably need generics in OCL.

The opinions of the OMG guys would be interesting ;-)

Friday, February 5, 2010

Tooling to help you starting a code generator from an example - To go Further...

Few weeks ago Cedric Brun announced a new way to create in a few minutes a pragmatic code generator with Acceleo. He said that Acceleo provides a specific tooling to help you starting a code generator from an example :
  • the new file wizard with the option to initialize it with an existing file content
  • the search & replace smart completion to quickly transform the example to a real template we can apply on a model
  • the "for" closing brace completion auto-magically find a coherent place

Since his message, we have added several menu items to go further :
  • "Refactor > Extract As Template..." to create a new template with the selected text
  • "Source > As Protected Area..." to define a protected area where we can regenerate target files without losing any modification
  • "Quickfix" when an operation call doesn't compile, you can create a new template or a new query that make the compilation work

New Acceleo naming conventions

Acceleo 3.0 is coming soon... For your information, we will change the way we name everything to follow the new naming conventions of the MTL OMG standard. The main change is that the code generation file will be named "Module". To help you understand how to use the new Acceleo wizards, you have to know the following mappings :
  • An Acceleo 2.6 module will become an Acceleo 3.0 project
  • An Acceleo 2.6 template will become an Acceleo 3.0 module file
  • An Acceleo 2.6 script will become an Acceleo 3.0 template block

Monday, January 18, 2010

The Eclipse Con 2010 Acceleo submissions have been accepted

My submission has been accepted ;-) Each year, in California, the Eclipse Foundation, organizes the conference « Eclipse Con » which gathers 1500 developers.

Last Year, Acceleo has been promoted as “Best Open Source Eclipse-Based Developer Tool”. This international award has rewarded several years of work of Obeo and Acceleo community to produce one of the best tool for model driven.

This year, we'll show the Acceleo 3.0 version which will be final on June 2010. This version is really important for us because this is the first time we plan to graduate under Eclipse.

Obeo will be at Eclipse Con 2010 and will present these talks:

I'll be happy to see you there...

Thursday, December 10, 2009

Acceleo Code Generation : Let's start with an Android example

This is the title of the tutorial I have just submitted for Eclipse Con 2010

Here is the description of the tutorial :


Acceleo is a pragmatic implementation of the OMG* standard for code generation called MTL*. Still in incubation state, we plan to have Acceleo graduate for the next Eclipse simultaneous release (Helios).

Being an expert at code generation or Acceleo is not necessary to get started on your first code generator : using the Acceleo editor and the powerful features it exposes (completion, syntax highlighting, on-the-fly compilation, quick outline, ...), it is very easy to get started once you understand the most basic principles.

This tutorial presents both the MTL language and the Acceleo Development Toolkit which is provided in the M2T project. Beginners will learn what code generation, M2T, and Acceleo are, as well as how to use them on a concrete case-study. Acceleo addicts will discover the new standard syntax, new functionalities and techniques. We will give you enough of the basics to create your own code generation for a specific target system. We have chosen the Android platform as a target to show that we can also use Acceleo for mobile software.

Here is the tutorial agenda :
- Acceleo : What's that new code generation engine?
- Create an Android prototype and its corresponding model
- Initialize your code generation project from the prototype
- Editing your code generation file to make the Android prototype run
- Launching your code generation on another model example
- Packaging as an eclipse plug-in and for standalone usage
- Create new Android applications in few clicks
- How to override a specific behavior in the target environment
- On the developper side : How to make your own extensions with Acceleo?

We'll end the tutorial with other complex code generation examples made with Acceleo : EEF, UML to Java, Ecore to python, Migrating from a language to another...

*OMG : Object Management Group
*MTL : Model to Text Language

Tuesday, November 10, 2009

Paris Eclipse DemoCamp 2009

The Eclipse DemoCamp comes to Paris the 17th of november at 18h30. I'll present the first Eclipse version of the Acceleo code generator. I hope we will have lot of attendees.

It's free and you can register here :
http://wiki.eclipse.org/Eclipse_DemoCamps_November_2009/Paris