Question - Explain MVC pattern.
Answer -
Model-View-Controller (MVC) is a design pattern that divides a software application into three segments namely the Model, the View and the Controller.
- A model deals with the behaviour of the application. It contains the data and business logic of the application. It notifies views and controllers when there is a change in its state.
- A view renders the information to the user so that it looks attractive and appealing. It takes information from the model using which it generates output.
- A controller takes input from a user and sends the command to model or view. It controls the flow of the application.