Explain MVC (Model-View-Controller) in general?
Manoj Bhoir
Model-View-Controller[MVC] When user requests, the request hits the "Controller". The Controller asks the "Model" for data. The Model gives the data to the Controller from the DB. The Controller formats the data and passes them to the "View". The View renders the Html that needs to be sent to the Client
MVC pattern forces a separation of concerns, it means domain model and controller logic are decoupled from user interface (view). As a result maintenance and testing of the application become simpler and easier.
In model view controller when the enduser requested any data it directly hit to controller, the controller contact model to get the data from the database or webservice and it will pass to controller, the controller will bind the data to view. - There is no code behind - There is no view state - There are no server controls - No page life cycle
To describe MVC the main part is Controller where are all logic are implemented. So Each controller interaction with Model and View.U are able to call Model in Controller function .
Model is representing the application part and implements the data logic.View is representing the User interface part and display data on browser using Controller part.Controller is classes. In this part collect user Request.
modal-class that contain application logic related to data controller-classes that are invoked for incoming URL requests, retreive data from database and ultimately a response is send back to the browser. view-class that contain all html code related to GUI
Basically MVC is separation of concern means all properties,operation with database done in Model. All UI related part handled in View. Controller calls the appropriate action to perform operation on model and returns related view to end user.
MVC (Model-View-Controller) is an architectural software pattern that basically decouples various components of a web application. By using MVC pattern, we can develop applications that are more flexible to changes without affecting the other components of our application.“Model”, is basically domain data.“View”, is user interface to render domain data.“Controller”, translates user actions into appropriate operations performed on model.