Why?
Separate business code from data access
- Separation of concerns
- Testability
Intent
Encapsulate data access
- Data appears to live inside an in-memory collection
Demo
Applicability
Consequences
Increased level of abstraction- More classes, less duplicated code
- Maintainability, flexibility, testability
- Shielded from infrastructure
- Harder to optimize
Related Patterns
- Unit of Work
- Specification
- Identity Map
- Decorator
No comments:
Post a Comment