A hotel room booking app which is implemented under the principle of Domain-Driven Design. Also we used some tools such as user story mapping, specification by example, and event storming to help us model the domain.
Use case exploration:
- User Story Mapping: build a big picture and general use cases
- online collabroation tool: miro project
- Specification by Example: for each user story, specification by example helps elaborate business logic
- online collabroation tool: miro project
- cucumber-js
- Event Stroming:
Development Methodology:
- Test-Driven Design
- Behavior-Driven Design
- Domain-Driven Design
Development Framework and tools:
- ExpressJS: nodeJS http framework
- TypeScript: a typed superset of JavaScript that compiles to plain JavaScript
- Jest: testing framework
- CircleCI
- ESlint
- all private properties
- public getters & private setters
- behavior-driven
(o) a.updateInfo(name, ..,,.., ...); (x) a.setXXX();
Why used props
?
it is just a simple way to avoid tons of this
assignment
http://www.plainionist.net/Implementing-Clean-Architecture-Controller-Presenter/ https://crosp.net/blog/software-architecture/clean-architecture-part-2-the-clean-architecture/
At first, I put all external npm modules in src/booking/infrastructure/
, and they all
implemnt interfaces from src/booking/usecase/
.
for example, if I want to use bcrypt
packages, first I would declare an interface:
src/booking/usecase/infrastructure/i-bcrypt
, then create src/booking/infrastructure/bcrypt
to
implemnt the interface.
After that, I can injection the bcrypt dependency into usecase constructor to avoid violate the direction of dependency; however, it doesn't worth taking so much time for a single utiliy.
The advantage is obvious, but here are disadvantages:
- Hard to used by other bounded context.
- Too much work for a simple utility.
- Make constructor too complicated to use (more parameters)
- eslint setup: https://mhartington.io/post/typescript-eslint-setup/