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                      
tip   SiteMap shows list of All Categories in this site.
Google
   
 
Categories  >>  Software  >>  Java Related  >>  Java J2EE  >>  Struts
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
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 ?    183 Yes 56 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 ?    129 Yes 29 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 ?    49 Yes 99 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 ?    38 Yes 49 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 ?    136 Yes 17 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 ?    120 Yes 11 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 ?    45 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 ?    33 Yes 15 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 ?    21 Yes 10 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 ?    12 Yes 15 No
Satya
 

 
 
 
Other Struts Interview Questions
 
  Question Asked @ Answers
 
can anyone help me to send the code for Jasper Reporting in java?plz CSC3
explain the struts-configuration file? TCS3
how to write my own Action servlet by extending pre-defined Action servlet in struts config. Sony2
what are the actions in struts? Wipro9
what are java stuts? what are there uses Tech-Mahindra2
Difference between JSF Framework and Struts Framework. Accenture12
shall we use any name for deployment descriptor of struts instead of struts-config.xml Polaris3
i have list of values(e.g 100). using logic:iterate, how can i print the multiples of 5th element? how the logic:iterate will understand the multiples of 5. CTS2
Where can i get jar file for use the struts-tags in struts2?  2
What is the main difference between Mvc1 and Mvc2 Architecture?? Ness-Technologies7
multiple instances for action class is it possible iFlex8
Can we write our own ActionServlet for front controller of Struts Applications? NIIT1
 
For more Struts Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2010  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com