Hi,
I was reading the nice tutorial at http://blog.jteam.nl/2010/11/12/tutorial-getting-started-with-cqrs-and-axon-framework/ and stumbled upon the following configuration lines:
<axon:event-sourcing-repository id=“orderRepository” aggregate-type=“com.acme.oms.commandhandling.Order”/>
<axon:jpa-event-store id=“eventStore”/>
<axon:event-bus id=“eventBus”/>
<axon:command-bus id=“commandBus”>
…
</axon:command-bus>
I was thinking what would happen if you’ve got 10 Aggregate Roots (AR’s). That would mean that the line:
<axon:event-sourcing-repository id=“orderRepository” aggregate-type=“com.acme.oms.commandhandling.Order”/>
will be duplicated 10 times.
It would be nice to use convention over configuration. The above, except for the commandbus, could be done with an tag like:
<axon:annotation-config event-store=“jpa” repository=“event-sourcing” />
You could use the component-scan to find all AR’s and create a repository for them based on the name of the AR and the suffix Repository.
And if you want to do something non default you can always create the needed beans yourself. For example the commandBus with a SpringTransactionalInterceptor
Is this possible and would it be a nice feature?
Martin