MVC architecture
MVC is a widely used software architectural pattern in GUI-based applications. It has three components, namely a model that deals with the business logic, a view for the user interface, and a controller to handle the user input, manipulate data, and update the view. The following is a simplified schematic that shows the basic interactions between the various components:
Let's further discuss each of these components.
Model
The model component of the MVC architecture represents the data of the application. It also represents the core business logic that acts on such data. The model has no knowledge of the view or the controller. When the data in the model changes, it just notifies its listeners about this change. In this context, the controller object is its listener.
View
The view component is the user interface. It is responsible for displaying the current state of the model to the user, and also provides a means for the user to interact with the application. If a user action...