Where are all the implementation classes for the query related interfaces in Axon-trader?

Hi,

I’m trying to understand how the query part of an CQRS-based application is working (Axon), and thought that Axon-trader would give me some insight:) I can find a lot of interfaces (UserQueryRepository, CompanyQueryRepository, OrderBookQueryRepository, PortfolioQueryRepository, TradeExecutedQueryRepository, TransactionQueryRepository) which relates to queries. They all extends PagingAndSortingRepository, but I can’t find any of the implementations, I assume I’m not paying close enough attention to the code somehow:) Can anyone tell me where they are?
And I assume that since the Axon-trader is using Mongo as it’s underlying persistence mechanism, that the query implementation classes will make use of http://www.axonframework.org/apidocs/1.2/org/axonframework/eventstore/mongo/MongoEventStore.html and/or http://www.axonframework.org/apidocs/2.0/org/axonframework/eventstore/management/EventStoreManagement.html to get the events needed to return what the specific query require.

Am I on the right page? :slight_smile:

Best regards,
Viggo

Hi Viggo,

the sample uses Spring data, which allows repositories to be defined simply by creating an interface. The method name defines what Spring data needs to do.

The query part of a CQRS based application is not much different from any other application. Although it’s generally just faster ;-). Simply return DTO’s (preferably read only) from your queries.

Hope this helps.
Cheers,

Allard