The problem's domain for this project is just a very very simple PetShop
Functions
- List all Pets
- Add a Pet (to the shop)
- Change a Pet's Name
- Sell a Pet
- Return a Pet
For the sake of understanding how the program was evolved, this repo show the implementation of the Use Case with these business logic implementation patterns:
- The Legacy
- Transaction Script
- Active Record
- Domain Model
- Event-Sourced Domain Model
The UML class diagrams were generated by goplantuml
and can be rendered via PlantUML
The implementation use RDBMS (MySQL) with JSON feature as an event store.
To run program you must start MySQL as a docker first, just docker-compose up -d
will get MySQL up and running for you.
Then prep the databases and tables using scripts in sql
folder.
run legacy program
make run0
run transaction script program
make run1
run active record program
make run2
run domain model program
make run3
run event-sourced domain program
make run4