The data is ready to be exposed to potential clients (the applications that will display and edit its content). However, a direct connection between the client and the database will make a very strong coupling. If we decide to switch to another storage type, the view would have to be rewritten, partially at least.
This is where the model comes to our rescue. It is an abstract layer that communicates with the data (our database) and exposes this data to the client in a data-specific, implementation-agnostic form. This approach is a direct offspring of the Model View Controller (MVC) concept. Let's recapitulate how MVC works:
- The Model manages the data. It is responsible for requesting data and updating it.
- The View displays data to the user.
- The Controller interacts with both the Model and the View. It is responsible for feeding the View with the correct...