This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Patterns question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Patterns question" Watch "Patterns question" New topic
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: 14687
    
  16

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: 281


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
Bartender

Joined: Aug 06, 2010
Posts: 543
    
    4

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 SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Patterns question