Research Notes
What I want to design for
- Avoid Polluting application level code with trivial conditions
- Move pre-conditions to application edge, so domain can focus on business logic
- Domain is always in valid state
- Domain doesn't have to be as defensive
- NOT Putting a guard class or pre-condition inside every single method being dealt with
- NOT Copy and pasting guard clause in every single area
- Custom predicates for guarding to avoid nesting
- Chain together series of processing steps in an organized way
- Passing a callback into the guard clause, if it passed execute the callback
- SRP, each stage focuses on a specific task
- Stages can be re-used and modularly moved
- Allows stage independent testing
- Result from previous task leveraged in next task
- Approach
Pipeline - a chain of steps
Step - a specific task
Data - information that passes between steps
- Russian doll model example → Middleware
- One filter causes the next filter
- Same uniform interfaces
- Call stack originates from the beggaring
- You can short circuit along the way