The Model View Controller (MVC) is a design pattern
built based on keeping the presenting data separate from the methods that
interacting with the data. The pattern is make up of 3 parts: Model,
View and Controller.
The Model represent data and business logic. It is to store
data permanently to be used in the overall design. Access needed to be granted for
the data to be viewed, collected or written. It is the bridge between the View and
the Controller in the pattern. It doesn’t require response from the
other parts, its role is to process the data into its permanent storage or seek
and prepare data to be passed to the other parts.
The View represent user interface. It is to get the data from
the model to display as a final output. The design generated by the view can be
used for user to interact with the Controller to trigger an action.
The Controller represent request handler. It is to handle all
the logics. It updates the model with the data inputted or submitted by the
user. It also render the data, pass and process through the model, to be
display in the View. Without the user, controller will not be required.
Advantage of MVC:
Ø Simultaneous development – Many people can work
Ø High cohesion – Logical grouping
Ø Low coupling – Low interdependence between
Ø Ease of modification – Good for development
Ø Multiple views for a model – Can have a lot of
Disadvantage of MVC:
Ø Code navigability – Hard to learn
Ø Multi-artifact consistency – Need to be
Ø Pronounced learning curve – Need to learn a lot
AppController extends Controller