2

I have a DSL which is based on a custom metamodel, which in its turn is based on EMF/Ecore. I am trying to figure out which solution to choose, and I cant find any decent comparisons anywhere.

Does anyone have any reasons why I should choose one over the other?

What I know so far is that Acceleo uses a OMG standardized language, but it seems harder to use than Xpand.

anders
  • 772
  • 1
  • 10
  • 17

5 Answers5

6

First of all, I wonder why you consider Acceleo more difficult to learn than Xpand, while both languages have differences (blocks and delimiters for example) they have quite a similar structure. I won't details all the elements in both languages but, for example, I don't see such a difference between something like:

«FOREACH myAttributes AS a»«a.name»«ENDFOREACH»

and

[for (a: Attribute|myAttributes)][a.name/][/for]

Both are template based languages and as such they have quite the same structure. The main difference between Acceleo and Xpand comes from the fact that Acceleo is based on the standards MOFM2T and OCL from the OMG and the tooling.

I am not very familiar with Xpand tooling but you can find more about it on their wiki. Acceleo on the other side contains an editor with syntax highlighting, code completion, error detection, refactoring and more. It also contains a debugger, a profiler, Ant and Maven support. You can also easily deploy your generators as Eclipse plugin for other users or use them out of Eclipse in a regular Java application. You can find more information on Acceleo here. You can see in videos most of the features of Acceleo on the Obeo Network (registration required).

Finally, the latest activity on xPand as occurred a year ago while Acceleo is actively developed. You can even follow the Acceleo development on github if you want.

Stephane Begaudeau

Disclaimer: I am one of the member of the Acceleo dev' team.

sbegaudeau
  • 1,504
  • 13
  • 18
  • Appreciate the answer! From what I'm reading though, it seems they almost have the same features (not sure about debugging/profiling). I will take a closer look at Acceleo anyway, just to see if I like it more than Xpand :) – anders Sep 13 '11 at 15:43
1

I've been using the old 2.x Acceleo on a full scalled project and done some test with the new one. The langage is pretty easy to use, but with the new version it's a little bit more difficult to bind some java code to your template when the script langage is not enought.

I was a very big fan of the 2.x, but with the 3.x, I add lots of troubles to make it work. You have to write java code to handle eclipse resources for instance. I totaly gave up when updating to juno, my acceleo projects didn't worked anymore and I didn't manage to correct it in two days. I hope they will make it easier to use out of the box.

Fericelli
  • 320
  • 3
  • 9
1

I am a dabbler, not an expert.

My impression is that if you need little more than a templating language, then Xpand is the way to go. Otherwise, pick Acceleo - but as you say, the learning curve is very steep.

When do you need more than a templating language? For me, they seem to run out of gas when the structure (not content) of the output is dependent on multiple independent pieces of the input. If you don't want to get into Acceleo, but have one of these cases, consider inventing an auto-generated "shim" language that gets you partway from input language to output language, perhaps with a lot of redundancy in it to avoid lookups at template-generation time.

Ed Staub
  • 15,480
  • 3
  • 61
  • 91
0

In my case, I use a custom meta-model (derived from UML2) with custom stereotypes and stereotypes properties). I tried both Acceleo and Xpand template languages. Indeed they are pretty similar in term of structure and capabilities.

However, I can see one big difference (which makes Xpand much better in this use case): you can use your custom stereotypes in your Xpand templates. Xpand engine brilliantly chooses the "best matching template/rule" for every stereotype (taking into account inheritance between stereotypes as well). Furthermore, it is very easy to obtain stereotype properties. These two "features" make the templates very elegant, compact and readable. For example:

«DEFINE myTemplate FOR MyUmlProfile::MyStereoType»
MyValue: «this.myStereotypeProperty» or simply: «myStereotypeProperty»
«ENDDEFINE»

In Acceleo, I found it clumsy to achieve the same (longer statements, more code) and my templates ended up lengthy and complex. The positive thing about Acceleo, however, was that it worked conveniently from IBM RSA (applied directly to RSA (emx) models). It has code highlighting and auto-complete working nicely.

Xpand only worked if I exported my RSA models to ".uml" (~XML) format. It doesn't offer code highlighting or auto-complete (or at least I didn't figure out how).

Considering all pros and cons, I still vote for Xpand (in my use case).

Markov
  • 1
  • 1
  • For using UML profiles with Acceleo, have you seen this? http://www.eclipse.org/forums/index.php/t/205038/ – PALEN Nov 16 '14 at 15:54
0

Basically the main difference is that ACCELEO is an implementation of the MOF Models To Text Transformation Language which is the OMG (Object Management Group) Standard for the definition of Models to Text transformation. It is therefore a standard language designed by the same group ho designed MOF, UML, SysML and MDA in general. XPAnd is a language which I guess existed before the standard but it is now different from it.

If you start from scratch then start with Acceleo.

Andrea Sindico
  • 7,358
  • 6
  • 47
  • 84