Components
The MVC framework has three components:
- Model -- the engine or brains
- View -- the looks (buttons, input fields, labels, colors, ...)
- Controller -- controls view activities, works with both the view and model
We can think of both the view and controller as living in the user interface (UI) layer, with the view being the looks, and the controller being the code/logic.
Controller
Some things the controller does:
- Refreshes the view values from the model values
- Applies (sets) view values into model values
- Handles view events and sends the appropriate message(s) to the model based on the event