System Design
15. Software Design PatternsAnimated walkthrough
Service Layer Pattern
A layer that defines the application's operations.
The idea
Services coordinate use cases, transactions and repositories, keeping controllers thin.
Watch it work
The steps light up one at a time. Use the controls to pause or step through.
- 1Controller receives the request
- 2Calls a service method
- 3Service coordinates repositories
- 4Returns the result
1/4
Step by step
- 1Controller receives the request
- 2Calls a service method
- 3Service coordinates repositories
- 4Returns the result
Where it is used
Business applications.
Watch out for
Anaemic services that only forward calls.