O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

But then his friend Kim takes a look

Kim comes in and says that while it IS an MVC design, it’s a dumb one. Sure, the business logic has been pulled out into a Model, and the servlets act as the Controllers working between the Models and Views so that the Models can be brain-dead about the Views. That’s all good. But look at all those little servlets.

What do they even do? Now that the business logic is safely tucked away in the Model, the servlet Controller isn’t doing much except some generic application stuff for this app, and, oh yeah, it does update the Model and then it kicks the View into gear.

But the worst part is that all that generic application logic is duplicated in every single frickin’ servlet! If one thing needs to change, it has to change everywhere. A maintenance train wreck waiting to happen.

“Yeah, I felt a little weird about the duplicate code,” says Bob, “but what else can I do? Surely you don’t mean for me to put everything in a single servlet again? How could that be good?”

image with no caption
image with no caption

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required