|
* A model could be a single object or Arrays of objects or some structure of objects. Connection Data... * There should be a one-to-one correspondence between the model and its parts on the one hand, and the represented world as perceived by the owner of the model on the other hand. * For simple models using a table gateway/active record implementation may work. * Some Models isolates the database from the rest of your application. * You controller should process the request and pass whatever relevant data is needed to the model. * The model (or the data mapper) then uses the connection. * Model uses bootstraps or posted datas |
MVC is
- Data (Model)
- An interface to view and modify the data (View)
- Operations that can be performed on the data (Controller)
M + V = C>> Controller is preparing Model then creating View.
In the Center there is a Controller
For Simple > Model = ‘ DATAS’
* The model is the data, and does nothing else.
Models (All of models in project ) does NOT depend on the controller or the view.
Controller Calling Model then pushing it to View. Controller is handling. But for the preparing the datas, controller does not effect how the model creating data sets, structs, objects.
Controller says model to that: Prepare user_table[array] ,
After pushing this object to View, View is using this table,
what is Controller ?
Such as button clicks. The controller depends on the view and the model.
Events.
The controller and the view are the same object. WHY > You can return a string as a page return “”
|
public string index2() { return "Index2 Return"; } |
What is the Advantage of model ?
Unnecessary complexity is the devil of software development.
Time loss for companies. . Complexity leads to software that is buggy, and expensive to maintain.
The easiest way to make code overly complex is to put dependencies everywhere.
* You can use model, Directly Copy paste inside of another Project. You can Call the Model from different Views, or Controllers.
>> Conversely, removing unnecessary dependencies makes delightful code that is less buggy and easier to maintain because it is reusable without modification.
* The primary advantage of the MVC is that makes model classes reusable without modification.