Skip to content

okkedek/economy-demo

Repository files navigation

Intro

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.

Domain

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.

Commands, Events and Exceptions

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

Aggregates, ValueObjects and Entities

We can identify the following object types:

object type root
Marketplace AggregateRoot -
Shop Entity MarketPlace
Consumer Entity MarketPlace
Product ValueObject -
Token ValueObject -

About

CQRS/ES demo application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages