Understanding implemented CQRS
npm install
ts-node src/commandBusExample/apps/book/app.ts
ts-node src/queryBusExample/apps/book/app.ts
- Layer: infrastructure
- Responsibilities:
- Receive post request
- Recover the data from request
- Create command with the data
- Send command to the bus
- Layer: application
- Responsibilities:
- Encapsulate the creation book data
- Layer: domain(interface)
- Responsibilities:
- Transport commands to corresponding handler
- Layer: application
- Responsibilities:
- Receive a command from bus
- Transform command data into value object
- Layer: infrastructure
- Responsibilities:
- CommandBus implementation
- Layer: application
- Responsibilities:
- Encapsulate business logic
- Layer: domain
- Responsibilities:
- Represent a domain concept
- Layer: domain(interface)
- Responsibilities:
- Domain contract with persistence layer
- Layer: infrastructure
- Responsibilities:
- Implementation of domain contract repository
- Layer: infrastructure
- Responsibilities:
- Receive get request
- Recover the data from request
- Create query with the data
- Send query to the bus
- Layer: application
- Responsibilities:
- Encapsulate the find book data
- Layer: domain(interface)
- Responsibilities:
- Transport query to corresponding handler
- Layer: application
- Responsibilities:
- Receive a query from bus
- Transform query data into value object
- Layer: infrastructure
- Responsibilities:
- QueryBus implementation
- Layer: application
- Responsibilities:
- Encapsulate response data as primitives
- Layer: application
- Responsibilities:
- Encapsulate business logic
- Layer: domain
- Responsibilities:
- Represent a domain concept
- Layer: domain(interface)
- Responsibilities:
- Domain contract with persistence layer
- Layer: infrastructure
- Responsibilities:
- Implementation of domain contract repository