Components of MVC architecture, i.e. Model, view and controller

Explain the 3 main components of MVC architecture. i.e. Model, view and controller.

Model:
In the MVC pattern, the component,” model” comprises the code that is to deal with the database (can be a simple Java bean). It is built without appearance concerns at the time of presenting to the user. To perform its functionality, it implements the public functionality. A model in Java application consists of one or more classes that extend the class java.util.Observable which provides the notified infrastructure needed to support a set of views.

View:
A view provides multiple graphical user interface components to interact with the model. The values that a querying process delivered by a model will be displayed by the model. At the time of user updation of a model through view, the view communicates these updations to the controller to perform the desired modifications. The views must implement the java.util.Observer interface.

Controller:
The controller plays the role of updating the model through views as and when it is needed by the user interactions. The controller can invoke the model to perform the updations. The controller interprets the inputs from the user carry forward these inputs and maps these into common commands that are to be sent to the model.

Explain the 3 main components of MVC architecture. i.e. Model, view and controller.

An MVC application is a collection of model, view and a controller triplets, each responsible for a different UI element.

Model:
1. It is the domain-specific representation of the data on which the application works.
2. When a model changes its state, domain notifies its associated views so they can refresh.

View:
1. Renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes.
2. In web applications where the view is the HTML or XHTML generated by the app.

Controller:
1. Receives input and initiates a response by making calls on model objects.
2. In web applications, the controller receives GET or POST input and decides its own action.
MVC - Benefits of MVC pattern
Benefits of MVC pattern - Separation of concerns: The separation the three components, allows the re-use of the business logic across applications...
Explain the disadvantages of MVC pattern
Disadvantages of MVC pattern - The complexity is high to develop the applications using this pattern...
MVC - Explain the 3 MVC framework that are within JFace, i.e. JFace viewers, JFace text
MVC framework - The implementation of MVC framework in JFace is done by using content provider and label provider..
Post your comment
Discussion Board
Good
Good Work
Shadow 06-21-2017