• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference b/w MVC and Front Controller!

 
Verity smith
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I am getting confused b/w mvc and front controller pattern.Can anyone please explain the difference b/w these two.

Thankx
verity
 
Panagiotis Varlagas
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, Front Controller is one of the 15 J2EE patterns in the J2EE Patterns book by Alur et al. MVC in not; actually MVC originates in the Smalltalk OO architects/designers/thinkers back in the 80s, where what they wanted to do is be able to have more than one views for the same model. A prime example of the application of MVC in Java in what was pretty much its original context and in a non-web context that is are the Swing classes. For instance, JTable is associated to a model which contains its data, and one can pretty much switch views at will so that one time the JTable has a Motif look and feel, the next time a Metal look and feel and so on.
So:
(1) MVC and front controller have different historical paths and MVC predates Front Controller
(2) Front Controller is restricted to the J2EE world, whereas MVC is a more general and rather architectural pattern (i.e. more high-level), applicable to (and originating from) non-Web contexts too
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this post.
HTH
 
Amer Khan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server-side implementation of MVC design pattern:
The JSP Model 2 architecture(MVC), is a hybrid approach for serving dynamic content, since it combines the use of both servlets and JSP. It takes advantage of the predominant strengths of both technologies, using JSP to generate the presentation layer and servlets to perform process-intensive tasks. Here, the servlet acts as the controller and is in charge of the request processing and the creation of any beans or objects used by the JSP, as well as deciding, depending on the user's actions, which JSP page to forward the request to. Note particularly that there is no processing logic within the JSP page itself; it is simply responsible for retrieving any objects or beans that may have been previously created by the servlet, and extracting the dynamic content from that servlet for insertion within static templates.This approach typically results in the cleanest separation of presentation from content.

MODEL---------bean
VIEW---JSP
CONTROLLER--------servlet

Front Controller:
FC design pattern is a certain way(pattern) of implementing the Controller(servlet) part of MVC architecture.
[ June 25, 2003: Message edited by: Amer Khan ]
 
Verity smith
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx Amer, Panagiotis and Andres
for the excellent explanation.
[ June 22, 2003: Message edited by: Verity smith ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic