Concept Flow - Service layer pattern
Client Request
Controller receives request
Controller calls Service Layer
Service Layer processes logic
Service Layer calls Data Access Layer
Data Access Layer interacts with DB
Data returned to Service Layer
Service Layer returns result to Controller
Controller sends response to Client
The service layer acts as a middleman between controllers and data access, handling business logic and keeping code organized.