In contrast to the more frontend oriented voxelprinter demo, this application aims to demonstrate backend techniques, including Domain Driven Design (DDD), Command Query Responsibility Segregation (CQRS), Event Sourcings (ES), microservices, API's, etc.
Since we'll be working with DDD, lets start out by describing our fictitious domain in terms of a ubiquitous language:
This application models a marketplace where consumers trade products with shops for tokens. Every shop sells only a single type of product with limited stock. Every product costs one token. Shops can only sell product after they have opened. If a shop runs out of stock it closes. Consumer can only buy product after they have entered the marketplace and until the have left.
Here this list of commands and events that may occur in this model:
command | events | exceptions |
OpenShop | ShopOpened | - |
CloseShop | ShopClosed | ShopAlreadyClosed |
EnterMarket | ConsumerEntered | ConsumerAlreadyEntered |
LeaveMarket | ConsumerLeft | ConsumerNotInMarketplace |
TradeProductForToken | ProductSold, ShopClosed | ShopNotFound, ConsumerNotFound, ShopIsClosed, ShopOutOfStock, ConsumerHasInsufficientTokens |
We can identify the following object types:
object | type | root |
Marketplace | AggregateRoot | - |
Shop | Entity | MarketPlace |
Consumer | Entity | MarketPlace |
Product | ValueObject | - |
Token | ValueObject | - |