Proxy, in the Java context, is defined as having the authority to represent another object. The proxy design pattern is true to its name in that it establishes a placeholder so that an object other than itself can control access. Pointer object references lack sophistication. Proxy references can accomplish the following with regards to an object reference:
- Utilize smart pointers that can count the number of references to a given object. This supports garbage collection.
- Object locking so it cannot be modified by other objects.
- Memory loading enhancements.
The primary justification for using the proxy design pattern is to save the tremendous memory and processing time that is required to create complex objects.