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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset