Recall that a model is the code used to interact with the data in your application. If you work with a database, this code typically returns a list of data or a single record. The code also supports user interaction on that data (create, update, and delete). If you already have a set of classes for working with your database and expressing your business logic, you can use them for your model. If you don’t have these classes, you need to create them.
As an example, imagine that you have a database that contains a
Customers table. You could write a custom class to express the properties and validation rules of a
Customer object. You might also write functionality to get a list of customers, read a single ...