What is MVC Architecture?

Answer Posted / george dsouza

MVC Architecture
Posted on: March 12, 2008 at 12:00 AM
The main aim of the MVC architecture is to separate the
business logic and application data from the presentation
data to the user.
MVC Architecture



The main aim of the MVC architecture is to separate the
business logic and application data from the presentation
data to the user.

Here are the reasons why we should use the MVC design pattern.

They are resuable : When the problems recurs, there is
no need to invent a new solution, we just have to follow the
pattern and adapt it as necessary.
They are expressive: By using the MVC design pattern our
application becomes more expressive.

1). Model: The model object knows about all the data that
need to be displayed. It is model who is aware about all the
operations that can be applied to transform that object. It
only represents the data of an application. The model
represents enterprise data and the business rules that
govern access to and updates of this data. Model is not
aware about the presentation data and how that data will be
displayed to the browser.

2). View : The view represents the presentation of the
application. The view object refers to the model. It uses
the query methods of the model to obtain the contents and
renders it. The view is not dependent on the application
logic. It remains same if there is any modification in the
business logic. In other words, we can say that it is the
responsibility of the of the view's to maintain the
consistency in its presentation when the model changes.

3). Controller: Whenever the user sends a request for
something then it always go through the controller. The
controller is responsible for intercepting the requests from
view and passes it to the model for the appropriate action.
After the action has been taken on the data, the controller
is responsible for directing the appropriate view to the
user. In GUIs, the views and the controllers often work
very closely together.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use spring, if you are already using struts?

556


Explain how to work with error tags?

585


What is DynaActionForm?

597


Explain about the library tag?

594


What’s the utilization of struts.xml configuration file?

533






How to display validation errors on jsp page?

568


What is declarative exception handling in struts?

554


Which servlet does the struts framework use?

513


What’s the difference between validation.xml and validator-rules.xml files in struts validation framework?

583


How you will enable front-end validation based on the xml in validation.xml?

569


What is the purpose of @key annotation annotation?

592


What is interceptor struts2?

530


How do I access token?

495


What’s the difference between struts and turbine?

556


What validate() and reset() method does ?

539