| Author |
Patterns question
|
Nidhi Sar
Ranch Hand
Joined: Oct 19, 2009
Posts: 252
|
|
Mock question from HFSJ final mock exam:
You are considering implementing some variety of MVC in your Java EE n-tier application. Which are true?
Among the answers given correct is this one:
Both the Front Controller Pattern and Struts could be considered solution for this design goal.
I found this pretty confusing. How can one pattern (FC) be considered a solution for another pattern(MVC). Should this answer be marked correct?
|
"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
The Front Controller is part of the MVC. It is the main controller which receives all request and dispatches them to the correct controller. For example, the DispatcherServlet in SpringMVC is the front controller.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Javin Paul
Ranch Hand
Joined: Oct 15, 2010
Posts: 276
|
|
Struts is also based on Front Controller pattern where ActionServlet acts as Controller and dispatches request based on URL mapping defined in struts-config.xml
|
http://javarevisited.blogspot.com - java classpath - Java67 - java hashmap - java logging tips java interview questions Java Enum Tutorial
|
 |
Dieter Quickfend
Ranch Hand
Joined: Aug 06, 2010
Posts: 280
|
|
|
I guess it would be valid, as having a class that can be reliably called a "Controller" implies that there is also a View and a Model, which renders any project with a Front Controller doing what it's supposed to do, automatically MVC, more or less.
|
Oracle Certified Professional Java Programmer
|
 |
 |
|
|
subject: Patterns question
|
|
|