When we looked at the Decorator design pattern, we saw different ways of enhancing the functionality of an object. The Proxy design pattern is similar, but its goal is generally to preserve exactly (or as closely as possible) the object’s original API while offering certain internal enhancements.
Proxy is an unusual design pattern in that it isn’t really homogeneous. The different kinds of proxies people build are quite numerous and serve entirely different purposes. In this chapter we’ll take a look at a selection ...