Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC architecture

 
Hardy Cao
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i get the MVC architecture correctly:
would it be correct if i say that:
let's say there could be some jsp pages with only 1 servlet controller and a
couple of beans in a module. let's put it that my application consists of
modules. that means i have at least 1 servlet controller for each of my
module.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While it is usually pretty clear that Beans take care of the Model end, and JSP typically present a View, the Controller tasks can be spread out so I would not get dogmatic about it.
Bill
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"True" MVC was designed for an environment where the components are much more tightly connected than HTTP allows. Among other things, HTTP doesn't permit the controller to modify the view after it was sent nor for a view to talk back to the controller without being completely replaced (I'm talking web pages, not HTTP tunneling here, BTW).
Some quite usable paradigms have been made after the fashion of MVC that DO work in the HTTP world, such as Model 2. And this points out the value of using Patterns as guides vs. ironclad Rules. If you avoid dogmatism, you can adapt a pattern to make you more productive, thence creating a new pattern. If you look at Patterns as immutable Law, you'll end up choking on your own narrow orthodoxy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic