Let`s have a look at MVC, the Model View Controller. MVC is a design pattern for web applications. It consists of these three components:
Model: The model holds all the data, state and application logic. It provides an interface to manipulate and retrieve its state. It responds to requests of the View and instructions of the controller. It also informs the View about state changes.
View: The View receives all the data it needs and displays it in a User Interface. The View can request state information from the model.It also "talks" to the controller by e.g. informing it that the user pressed a button.
Controller: The controller controls the interactions between the model and the view. It sends instructions to the model to change its state based on what has happened (e.g. pressing a button) and requests the view to change its display.
Have you used the MVC yet?