State of Axon Auction Example

Hi all,

Just a short note that the "Axon Auction Example" is not dead :slight_smile:

I just made a detour to improve the generation process (that was
initially XML based: http://code.google.com/p/axon-auction-example/source/browse/#svn%2Ftrunk%2Fauction-parent%2Fdsl
).

I'm currently working on a small application that makes it possible to
describe the meta data of a CQRS application (Aggregates, Types,
Events, Messages, Sagas, Queries). The cool thing is, that the
application itself will be CQRS/Event Sourcing based.

Based on this information it will be possible to generate most of the
boilerplate code for a typical application. Of course it will be
possible to customize the (Velocity) templates used for code
generation. This way the user can decide how the concrete generated
classes look like.

The idea is to speed up the development not only for the auction
example application.

Cheers,
Michael

Hi Michael,

This is the first time I reply to this groups so I’m happy ^^ to contribute.

I was understanding you’re planning a kind of code generation based on velocity. Rather than saying why velocity is not the better tool for this, I’ll try to propose a new tool and explain why you should use it.

For this kind of stuff, I’ll recommand the use of something like Acceleo (http://www.eclipse.org/acceleo/) which is a mdd based tool.

Why ? Because the following :

  1. The modelization is easy , you can use as many metamodel as you want( emf, uml, dsl based ,…). In eclipse you have all the necessary.
  2. Acceleo handle the re-generation based on zone you define as protected. This means you can generate once , modify this zone, then re-generate without losing your modification
  3. The acceleo engine is embeddable easily in maven, ant, cli or whatever
  4. MOFM2T is an OMG language , “MOF Model To Text Transformation Language” http://www.omg.org/spec/MOFM2T/1.0/
  5. The standard templates will be reusable in a standard way by the community

My 2 cents

Cheers,
Epo

Hi Ebo,

For this kind of stuff, I'll recommand the use of something like Acceleo (http://www.eclipse.org/acceleo/) which is a mdd based tool.

I think you're right Acceleo is a good tool for code generation.

For the first step I just want to keep things simple. The model for
the application itself s CQRS/Event source based. This means there is
no Eclipse meta model we can use for code generation. It would require
an additional step to create an Ecore Meta Model from the Query
Database. This is something I have thought of but I wouldn't do it in
first place.

Another thing is that my experience with Eclipse Tooling is, that it's
difficult to use outside Eclipse. If you want to integrate something
from Eclipse in a Maven build it's not even easy to find a Maven
Repository to get the current version from.

For this reasons I choose Apache Velocity to generate the code. It's
easy, small and well documented.

But I'll keep Acceleo definitely in my mind for further enhancements!

Cheers,
Michael

Hi Michael,

I agree with you the first try must be simple.

The model I was talking is in any way stucked with eclipse. Eclipse and others modelization tools use
XMI which is another widespread standard. But I understand your point of not being forced to use a
particular tool for the modelization.

I think ones will be able to find eclipse artifacts in maven repos, with something like tycho.

Without talking about acceleo, you use xml as model input, but xml can have its own drawback. The first I see
is readability, then verbosity. Today you have a lot of tool that allow you to create your own external DSL
that will be lighter. This said, we always can create a dsl that generate in your xml format.

Please be sure to ask me if you need some pointers or help with acceleo.

Epo

PS : By the way my firstname is Epo not Ebo :slight_smile:

Hi Epo,

you use xml as model input, but xml can have its own drawback.

That's exactly why I dropped XML for the new version of the generator
application I'm currently working on (The URL included in the first
mail was a link to the old XML based version).

The new version is itself an Axon Framework based CQRS/ES application.
This means it has a domain model that reacts on commands and there are
events that help populating the query database and that are stored in
an event store. The model used for code generation is then just the
result some queries.

Cheers,
Michael