Skip to content

Domain Diagrams

Kenny Bastani edited this page Sep 27, 2018 · 5 revisions

Domain Diagrams

Welcome to the official wiki documentation for the Axon Trader reference example. Axon Trader is an end-to-end reference architecture maintained in partnership with AxonIQ and Pivotal Software, and is intended to be a practical example that demonstrates the best practices for implementing cloud-native event-driven architectures using Spring Boot, Spring Cloud, and Axon.

The comprehensive example contained inside this repository includes everything you'll need in a cloud-native production environment that utilizes Cloud Foundry. This reference example is built to demonstrate the very best capabilities of Pivotal Cloud Foundry's Application Service. While this reference application can be deployed to any distribution of Cloud Foundry, there are certain backing services that are only available via Pivotal's distribution, such as Spring Cloud Services.

The goals of this overview page:

  1. Teach you the Axon Trader domain
  2. Visualize and diagram the CQRS workflows
  3. Diagram and explain the architecture and trade offs

Domain Aggregates

The domain of the Axon Trader application is realistically complex, as demonstrated in the graph diagram below.

Transaction

Transaction is an aggregate that maintains the state of an Order. Using a Transaction, the systems knows whether an Order is accepted, cancelled, executed or partially executed. The Transaction has a reference to the OrderBook aggregate that the Buy or Sell Transaction was created for. The Transaction also has a reference to the Portfolio that started the Transaction.

Transaction Aggregate

Portfolio

Portfolio is an aggregate that contains money and stock Items. Using a Portfolio, a User can start a Buy Transaction or a Sell Transaction. The Portfolio also has the responsibility to reserve money for buy Orders and reserve stock Items for sell Orders. The Portfolio has a reference to the User.

Portfolio Aggregate

OrderBook

OrderBook is an aggregate that controls the matchmaking between Buy and Sell orders. An OrderBook entity tracks the list of buy orders and sell orders executed as Transactions by a User. When new orders arrive, the OrderBook stores them and checks if there is a match between the new order and one or multiple other orders. An OrderBook is related to a Company and represents one type of stock item.

OrderBook

Clone this wiki locally