ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Struts
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
What is MVC Architecture?
 Question Submitted By :: Sunayana
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is MVC Architecture?
Answer
# 1
MVC is model view controller architecture .
MVC is divided into 3 parts
1.MVC
2.MVC ->1 this is jsp and java bean commmunication.
3.MVC ->2 this is servlet+jsp+javabean+struts commun.

model is backend database or java bean.
view is output html 0r jsp.
controller is logic that is servlet.
 
Is This Answer Correct ?    206 Yes 64 No
Pkr_reddy
 
  Re: What is MVC Architecture?
Answer
# 2
MVC stands for Model(bean,EJB),View(Html,Jsp),Controller
(Servlet).MVC pattern is a collabartion of three components
model,view,controller.MVC pattern is a sequence of action
interactions starting with view,then controller and then to
model based on the data persistence.

MVC is an approach for developing interactive application
ie it results in events through user interactions.Model is
responsible for holding the application state,View is for
displaying the current model and controller handles the
event.
 
Is This Answer Correct ?    156 Yes 32 No
Mdsha_asiya
[Big Bizz]
 
 
 
  Re: What is MVC Architecture?
Answer
# 3
MVC means model view control architecture.
model is nothing but the member variable and method declaration.
view is the look and feel techinque.
control is how to control the components.
 
Is This Answer Correct ?    52 Yes 113 No
S.thirunavukarasu
 
  Re: What is MVC Architecture?
Answer
# 4
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
Ajit Shanbhag
 
  Re: What is MVC Architecture?
Answer
# 5
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.
 
Is This Answer Correct ?    148 Yes 21 No
Biswajit Roy
 
  Re: What is MVC Architecture?
Answer
# 6
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.



Advantages of MVC Architecture:

1. They are reusable:
When the problem 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.

3. Easier support for new types of clients:
To support a new type of client, you simply
write a view and controller for it and wire
them into the existing enterprise model.





Example of MVC architecture:





1. When the user Log In on the login page, a request
is sent to the servlet handler.
2. The servlet handler dispatches the request to the
appropriate control class. In this case,
Login control.
3. The Control performs the action requested by the
user on the Model; in this case the Login Model.
4. The Model returns a response; in this example, a
successful login message.
5. The Control either redirects to another page or
returns to the same page with new data since the Model has
been updated. In this case, the Control redirects to the
MyPage.
6. The Interpreter gets the HTML for the page
requested by the Control from the appropriate View, in this
case the MyPage View
7. The View returns the HTML for the page.
8. The Interpreter sends the HTML for the page back to
the browser.
 
Is This Answer Correct ?    132 Yes 12 No
Amulbaby
 
  Re: What is MVC Architecture?
Answer
# 7
MVC architecture acts just as an application interface.its
has got 3 parts
1) model
2) view
3) controller

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

Advantages

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
 
Is This Answer Correct ?    48 Yes 6 No
Jac
 
  Re: What is MVC Architecture?
Answer
# 8
Model-View-Controller (MVC)
Model-View-Controller architecture is used for interactive
web-applications. This model minimizes the coupling between
business logic and data presentation to web user. This
model divides the web based application into three layers:
1. 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 ?    35 Yes 17 No
Hrishikesh Nandanwar
 
  Re: What is MVC Architecture?
Answer
# 9
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 ?    23 Yes 11 No
Hghjgjh
 
  Re: What is MVC Architecture?
Answer
# 10
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
Satya
 

 
 
 
Other Struts Interview Questions
 
  Question Asked @ Answers
 
what is request processor class ? Fidelity 10
Can i use constructor in Action Class?If yes how?   8
why servlet is used as controller not JSP? MCS 6
how can u handle run time exceptions in struts and jsp plz explain briefly not single word answer? TCS 2
1.when actionservelet execute. 2.when web.xml executes   3
how to write my own Action servlet by extending pre-defined Action servlet in struts config. Sony 2
is it possible to see actionservlet in my system. if yes how   5
where you store password in banking project   1
Hi Friends, why struts introduced in to web application. Plz dont send any links . Need main reason for implementing struts. Thanks Prakash   4
what r the disadvantages of MVC-2 Architecture? Process-IT 2
How is the Struts framworl related to MVC2? Wipro 2
multiple instances for action class is it possible iFlex 8
 
For more Struts Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com