I am learning MVC and new to it. I have read some articles on MVC.
What I could understand was:
View is just front end that never directly communicate to Model. It always intrects with Controler.
Controller is a software component that will receive and respond to View and communicate to Model.
Model will have all programming logic, validations, database communications, services etc.
Is my understanding correct ?
I further want to learn:
where will be POCO classess in model ?
will model not became complex if all validations, db communication code and business logic will be there ?
If there will be muplitle classes/ libraries in model, will control able to talk to any of them directly ? and they will respond back to Controler and control will again communicate with View ?
thanks Thanks THANKS for helping and guiding.
You can think of the View as a template. Data from your view will get filled in to spots that you designate in the view. The View can also be an input template, where you designate fields used for input and those fields get sent to the controller.
The controller does most of the hard work. All web requests go through the controller. The controller acts as a mediator between view and model. The controller passes the model to the view, the view takes the model and uses its data to populate it’s fields.
The model is just a set of data objects that define your data model. Sometimes these will be stand alone classes that have no special features, sometimes they will be classes generated from a tool like Entity Framework.
MVC is just an framework that is designed to seperate your user interface into seperate components so that it is easier to maintain.