The aim behind asking this question is to improve my understanding of Java Proxies and delegation in general.
Asked
Active
Viewed 200 times
1
-
Define "delegate" and "delegation" as used in the post. – Jun 27 '12 at 18:56
-
I have edited the question to make it more correct. @pst I interpret delegator and delegation as defined by [Delegate Pattern](http://en.wikipedia.org/wiki/Delegation_pattern). – Jayant Jun 27 '12 at 22:15
1 Answers
1
Semantically a Proxy delegates to some implementation, but that is just a side effect of the intention of the Proxy Pattern.
The intention is to intercept and do extra logic or modify the logic before it does the delegation, or possibly affect the return value before the Proxy returns the results.
The interception and modification isn't the intention of the Delegate Pattern.
There it is an abstraction to make an interface in the system loosely coupled from the implementation.
There is a concept of Dynamic Proxies in Java which are Java specific, and their intention is for building Adapter Pattern and Decorator Pattern implemenations.