This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Front Controller vs Application Controller

 
Antonio Fornie
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all!

I don't know if I understand at all the difference between Front Controller and Application Controller. In a real project, what would be the resposibilities of each one? What tasks would be given to each one?

Thank you very much!

antonio
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Front Controller is used to group common functionality of a "user request" (security, internationalization, appropriate choice of views, etc.). And the Application Controller complements the Front Controller. Is used when the choice of views is very complex. That is it, generaly, the Application Controller is used to create and select complex views that vary depending on what the user informed (for example, a wizard). Just to clearify, the Front Controller can deal with it too, but in some cases it's better create a new component layer, that can do with the job and be reused.
 
Antonio Fornie
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!

But I think for such things as: security, internationalization... it's better to use a set of Interceting Filters. It's kinda using AOP for cross-cutting concerns. Then I could use another "thing" (class, component...) for application matters: choosing the view, filling some object with request parameters... Should it be done by the Front Controller or by the Application controller?
Resuming, if I have Intercepting Filters, Front Controller and Aplication Controller I see three patterns for only two kinds of tasks/responsibilities.

May be, what you mean is something like this:
Intercepting Filter -> pluggable behavior: security, i18n...
Front Controller -> request format matters: taking the request parameters to build a command or something similar.
Application Controller -> one we have a command, a state or whatever shows the actual state and the demanded service that is abstracted from HttpRequests and the likes, the Application Controller decides the View, the Application Service to call and so on...

Did I understand?

Thank you!

antonio
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I think for such things as: security, internationalization... it's better to use a set of Interceting Filters

I agree.

choosing the view, filling some object with request parameters... Should it be done by the Front Controller or by the Application controller?


The Front Controller should do it, and depends the case, Application controller could be add to choose the view.


I believe that these links would help us.

http://www.martinfowler.com/eaaCatalog/applicationController.html
http://www.martinfowler.com/eaaCatalog/frontController.html

http://www.martinfowler.com/eaaCatalog/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic