- Don't design a Model to be coupled to an API
- Create a Service that talks to both your Model and the API
- You have services, stateless objects that talk to the application
- You have records, objects that talk to the database
- And you have Wrappers, a thin class for a narrow interface to an API
- Services can also talk to other Services
- SRP Rule: A class should have one, and only one, reason to change.
- Controllers tend to authenticate, authorize, wrap HTTP, manipulate models, manipulate databases (reload), query the database, present models, contain view content, create response content, route, choose content type, contain model logic...
- "If you have a big thing, and you put it into a press to squeeze it out into a lot of little things, you'll have a lot of great little things that are better than the big thing.
- Split the controller into various singular responsibilities.