Generating axon-code from a diagram (visual editor)

I created a diagram describing the flow of an order handling process
in a system I'm building:
http://www.flickr.com/photos/perwiklander/5350435346/sizes/l/

I did this (quick and simplified) diagram to make it easier for myself
to keep track of all the event and command handling involved. Looking
at the result I came to think that a CQRS system built on Axon
Framework would be a very good candidate for a visual editor in an IDE
like Eclipse. At least for generating all base classes and wire them
up. Of course we cannot generate the logic that goes into command
handlers, event handlers, aggregate roots and sagas but the boiler
plate code should be "easy".

Events and Commands - If the editor allows us to define properties
(like a normal class definition in UML) these classes could be fully
managed.

Command handlers - By drawing connections from commands to command
handlers the tool can add stub handle methods with the appropriate
@CommandHandler annotations.

Event handlers - Same as command handlers, given connected events the
tool can generate @EventHandler methods.

Sagas - Same as event handlers, given connected events the tool can
generate @SagaEventHandler methods. The green stars in my diagram
denote saga starting events. The red stop signs denote saga ending
events.

Aggregate roots - I don't know if these can have a place in the
diagram as well, I left them out of this one. Perhaps they could be
drawn between a command handler and the event that is generated (and
applied to the AR).

So, is this just a bunch of wishful thinking? Does anyone have
experience of Eclipse visual editors?

I think this would definitely be a nice feature! The mapping from diagram to code you are mentioning sound very feasible to me. I am quite ignorant in the IDE plugin development area myself, though. But anyone who has developed a plugin before should probably be able to do this.

Someone else on this list has already suggested to create a plugin that does exactly the opposite: create wiring diagram from code. A plugin that can do both would really be powerful to have. Adding an event could be done in the diagram. Then just follow the “TODO: Provide implementation” (or whatever the method stubs will be)…

If there are any Eclipse/IntelliJ/NetBeans plugin devs on this list, please speak up…

Cheers,

Allard

It would be really nice if we have a standard library that able to scan the code in classpath and generate the said diagram.
Than it’s really a matter of the integration, whether netbean/intellij/eclipse or even creating report to html that needs to be worked on.
Wdyt? I think the html report would be the ideal start as it immediately benefit everyone?

Regards,
Edward Yakop