Design Patterns for Dummies. The Proxy Pattern
This is the second post in a series of post on Design patterns. Presently we are going through the structural patterns. In my previous post I had discussed about the Decorator Pattern. I will be writing about the proxy pattern today.
Proxy patterns is all about creating small objects which in turn are used in creating and accessing more complex objects.
Proxies act as frontend to classes that are complex or rather heavy in their operation. Proxies are similar to decorators in the sense that they both delegate requests to another object, however the proxy relationship is well know at design time for objects where as in decorators they are added dynamically. Proxies are to be used when, creation of objects of any class is expensive or when we need to access a remote object, or when we need to perform some action when an object is called or rather creation of objects only when an operation is called.
In my next post I will be discussing about the Bridge pattern.
Comments