Add README file with description of demo impl.
This commit is contained in:
58
README.md
Normal file
58
README.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Bank account reactive DDD DEMO
|
||||
This is the DDD reactive implementation of bank account example. The purpose of
|
||||
this demo is to demonstrate how to deal with data consistence in the reactive implementation
|
||||
using DDD (domain driven design) principles.
|
||||
|
||||
## List of design patterns used in this demo
|
||||
* DDD
|
||||
* message driven architecture
|
||||
* event sourcing
|
||||
* CQRS
|
||||
|
||||
## Technologies
|
||||
This demo is implemented using Spring reactor project.
|
||||
|
||||
## The implementation consists by two aggregates
|
||||
* `Account`
|
||||
* `Transaction`
|
||||
|
||||
Those two aggregates representing one bounded context `Bank account`.
|
||||
|
||||
## Supported operation by Account aggregate
|
||||
`account-domain-api` module contains definition of contract provided by `Account` aggregate.
|
||||
Here is the list of basic operations:
|
||||
* create account
|
||||
* deposit money
|
||||
* withdraw money
|
||||
* transfer money between two accounts
|
||||
|
||||
## Supported operation by Transaction aggregate
|
||||
`transaction-domain-api` module contains definition of contract provided by `Transaction` aggregate
|
||||
Here is the list of basic operations:
|
||||
* create transaction
|
||||
* cancel/rollback transaction
|
||||
* finish transaction
|
||||
|
||||
## Persistence
|
||||
Implementation is following CQRS and event sourcing design pattern. Persistence API is provided by
|
||||
`common-persistence-api`. This module provides in memory storage for:
|
||||
* events generated by particular aggregate `AggregateRepositoryImpl`
|
||||
* storage for view model `ViewRepositoryImpl`
|
||||
|
||||
## Business case representing of data consistency
|
||||
* Create two accounts `A` and `B` with specific amount of money
|
||||
* Create the transaction for transferring specific amount of money from account `A` to account `B`
|
||||
* Transaction finished: successfully or failed
|
||||
|
||||
### Transaction is successful
|
||||
* Transaction closes and informs about result.
|
||||
### Transaction failed:
|
||||
#### Failed due to account `A` doesn't have enough amount
|
||||
* Transaction closes and informs about result.
|
||||
#### Failed due to account `B` doesn't exist
|
||||
* Transaction returns money to account `A`
|
||||
* Transaction closes and informs about result.
|
||||
#### Failed due to cancellation
|
||||
* If money were withdrawn from account `A` -> money returns to account `A`
|
||||
* Transaction closes and informs about cancellation.
|
||||
|
||||
Reference in New Issue
Block a user