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

How about a “go-between” object?

A common solution to the design problems we left you with is to create a new object—a single, “go-between” object for the controller to talk to rather than having the controller deal directly with the remoteness of the remote model.

Problem 1: Hide the complex JNDI lookup

If Rachel’s controller lets a “go-between” object handle the JNDI lookup, the controller code can stay simpler, free from having to know where (and how) to look up the model.

Problem 2: Hide “remote-ness complexity”

If the “go-between” object can handle talking to the stub, Rachels’ controller can be shielded from all the remote issues including remote exceptions.

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