What is MVC Architecture?

Answers were Sorted based on User's Feedback



What is MVC Architecture?..

Answer / nilesh

MVC architecture is Nothing but the 3 tier Architecture
Model-It Directly interact with the database
View-It Provides the GUI..Directly interacts with the user;
Controller-it is the interface between the View & Model..

The Controller which takes the input from the View Preprocessed it & sends it to the Model & then model send to the database. it get the response from the database & pass this response to the controller . controller will send the response to the View..

This is the Simple MVC architecture..
this architecture will be varry a little with respect to the application (Web or Standalone )..
thanks..

Is This Answer Correct ?    2 Yes 0 No

What is MVC Architecture?..

Answer / manish

MVC Architecture
It is just an application
interface. It has three parts.
1. Model
2. View
3. Controller
MVC was originally developed to map the traditional input,
processing, output roles into the GUI realm:
Input –> Processing –> Output
Controller –> Model –> View
The main aim of MVC architecture is to separate the
business logic and application data from the presentation
data to the user.
Architecture:

Model:
• A model is an object that manages information.
• It calculates, sorts, stores, retrieves, simulates,
emulates, converts, and does just about anything else you
can think of doing to information.
• The model by itself has no visual representation.
• It includes the validation rules.
• It does not know how to display the information it
contains.
• As MVC architecture the model information can be
divided into two categories:

i) Domain information Model
ii) Application information Model
I) Domain information Model:
• Domain information model includes that information
concerned with the problem domain.
• For example, if we have an airline reservation
application, then flight schedules, prices, seating
arrangements, and credit card numbers would all be domain
information.
II) Application information Model:
• Application information model is any information
that is used by the application but is not part of the
problem domain.
• In the airline reservation example, error messages
are part of the application information.
View:
• The view provides a visual representation of the
information contained in the model.
• As the information in the model changes, the view
should automatically change.
• A view depends on the information contained within
its model.
• Examples of views are input fields, text editors,
and even entire windows.
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.

View to model communication

The views know of the model and will interact
with the model.

• If a button is clicked an action
message might be sent to a model object in
order to get something done.

• If a new value is typed into an
entry field an update message might be sent to a model
object in order to give it its new value.

• If a value is needed for a display
an enquiry message might be sent to a model object in order
to get a value.


Model (and controller) to view communication

• Whenever some aspect of the model changes; an
aspect that is displayed in a view.
• Model and controller to communicate with view via
events.
• Using graphical components a list box, an entry
field or a radio button these view components will receive
event notifications such as needs contents, or clicked.
• The events will often come from the controller.
• Views register handlers for the events they wish to
handle.

Is This Answer Correct ?    3 Yes 2 No

What is MVC Architecture?..

Answer / 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

What is MVC Architecture?..

Answer / satya

Model: Model domain contains the business logics and
functions that manipulate the business data. It provides
updated information to view domain and also gives response
to query. And the controller can access the functionality
which is encapsulated in the model.
2. View: View is responsible for presentation aspect of
application according to the model data and also
responsible to forward query response to the controller.
3. Controller: Controller accepts and intercepts user
requests and controls the business objects to fulfill these
requests. An application has one controller for related
functionality. Controller can also be depends on the type
of clients

Is This Answer Correct ?    14 Yes 18 No

What is MVC Architecture?..

Answer / deepak

This MVC architecture is just a virtual representation of
an application.

Consists of 3 parts:
1> Model
2> View
3> Controller

The main motive of implementing the MVC Architecture is to
seperate the application data as well as the bussiness
logic from the presentation data for the user.

Model: When someone declares and defines the class
attribute names as well as the methods in order to define
the underlying bussiness logic for the problem statement(in
java).

View: This the output what the client observes or views on
his system or terminal.Thsi is the GUI interface that the
client directly interacts with.

Controller: Is the medium of interaction between the user
view and the bussiness logic . In other words , it is the
medium of interaction vbetween the model and the view. It
retrives the information from the view and sends it to the
model for its processing.It ikntercepts user requests and i
turn control bussiness objects to fulfill these
requirements.

Is This Answer Correct ?    7 Yes 12 No

What is MVC Architecture?..

Answer / sudheer reddy a

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.

1. 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.
2. 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.

Difference between Model 1 and Model 2 architecture:

Features of MVC1:

1. Html or jsp files are used to code the presentation.
To retrieve the data JavaBean can be used.
2. In mvc1 archictecture all the view, control elements
are implemented using Servlets or Jsp.
3. In MVC1 there is tight coupling between page and model
as data access is usually done using Custom tag or through
java bean call.

Features of MVC2:

1. The MVC2 architecture removes the page centric
property of MVC1 architecture by separating Presentation,
control logic and the application state.
2. In MVC2 architecture there is only one controller
which receives all the request for the application and is
responsible for taking appropriate action in response to
each request.

Is This Answer Correct ?    5 Yes 10 No

What is MVC Architecture?..

Answer / anurag somani

Model-View-Controller (MVC) is a design pattern that
simplifies application development and maintenance. It
achieves this by separating the application into three
logical components:
Model:The model layer is responsible for the business
logic of an application. It will encapsulate access to data
stores and will provide a reusable class library. Typically,
within the model, you will find facilities for database
abstraction, e-mail delivery, validation, and authentication.
View:The view layer is typically what would be considered
web design, or templating. It controls the look and feel of
data and provides facilities to collect data from the user.
Technologies exclusively found in the view are HTML, CSS,
and JavaScript.
Controller:The controller layer glues everything together
and merges the styling of the view with the functionality of
the model. It is responsible for collecting input data from
the view and deciding program execution. The controller will
call model facilities and interpret the returning data so
that it can be rendered by the view. It is also responsible
for all application exception and flow control.

Is This Answer Correct ?    1 Yes 6 No

What is MVC Architecture?..

Answer / shiva

Model–View–Controller (MVC) is a software architecture ,
currently considered an architectural pattern used in
software engineering. The pattern isolates "domain logic"
(the application logic for the user) from input and
presentation (GUI), permitting independent development,
testing and maintenance of each.
The model is the domain-specific representation of the data
upon which the application operates. Domain logic adds
meaning to raw data (for example, calculating whether today
is the user's birthday, or the totals, taxes, and shipping
charges for shopping cart items). When a model changes its
state, it notifies its associated views so they can refresh.
Many applications use a persistent storage mechanism such as
a database to store data. MVC does not specifically mention
the data access layer because it is understood to be
underneath or encapsulated by the model. Models are not data
access objects; however, in very simple apps that have
little domain logic there is no real distinction to be made.
Also, the ActiveRecord is an accepted design pattern which
merges domain logic and data access code - a model which
knows how to persist itself.
The view 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.
The controller receives input and initiates a response by
making calls on model objects.
An MVC application may be a collection of
model/view/controller triplets, each responsible for a
different UI element.
MVC is often seen in web applications where the view is the
HTML or XHTML generated by the app. The controller receives
GET or POST input and decides what to do with it, handing
over to domain objects (i.e. the model) that contain the
business rules and know how to carry out specific tasks such
as processing a new subscription.

Is This Answer Correct ?    4 Yes 10 No

What is MVC Architecture?..

Answer / ajit shanbhag

MVC is Model View Controller architecture. There is nothing
called as MVC1 architecture. The types are differentiated
as follows:

1. MVC -> Here the jsp acts as the controller.
2. MVC2 -> Here the flow is controlled by a single servlet.

Basically, the intension of the MVC architecture is to
provide flexibility and improve the performance of the
application by seperating the applcation into three layers.
The Model layer consists of the business logic and
interacts with the database. This consists of the java
beans, the EJBs etc. The output to the client is presented
by using the View layer. This consists of the jsps, html
etc. The controller controls the flow of the application.
In MVC application the jsp acts as the controller which
recieves the request and sends the response. Whereas in
MVC2 architecture there is central servlet which acts as a
single point control for the applcation flow. The response
is provided by the jsp.

Is This Answer Correct ?    42 Yes 55 No

What is MVC Architecture?..

Answer / bharat gangwani

all facts are correct

Is This Answer Correct ?    5 Yes 20 No

Post New Answer

More Struts Interview Questions

What does params interceptor?

0 Answers  


Explain about logic match tag?

0 Answers  


In which order struts framework searches for a message bundle?

0 Answers  


What is the difference between filters and interceptors ?

0 Answers  


What is the use of jsonvalidation?

0 Answers  






What do you mean by action errors and what are the results they force?

0 Answers  


What is actioninvocation in struts2?

0 Answers  


In struts.xml, what does the attribute "method" stands for in the "action" tag?

0 Answers  


Give an example of validates method used to avoid errors.

0 Answers  


How can link tag’s action attribute be used?

0 Answers  


Explain the core end goal while using java struts?

0 Answers  


can anyone help me to send the code for Jasper Reporting in java?plz

3 Answers   CSC, RFT,


Categories