• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Patterns question

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic