The Model (M)
Within this context, the Model represents the domain objects needed to express the business logic supporting the requirements inherent to the application. It's here that all of the use cases are represented as real-world abstractions and a well-defined API is made available to be consumed by any kind of delivery mechanism, such as the web.
Regarding traditional applications, all of the logic to interact with a database or middleware is implemented in the Model. However, the Model (the M in MVC) should expose functionalities (in terms of the business) that are easy to understand. We should also avoid building anemic models that only allow for interacting with the database and are difficult to understand for the rest of the team ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access