I was reading about proxy pattern in this article and understood the example, but this commentconfused me. The comment states:
There are 2 big problems with proxies, especially in enterprise environments.
1) You can't do self calls. A good example is a proxy that does transaction management or security. So you need to make sure that instead of doing a self call, you forward the call to the proxy. This makes simple classes complex.
2) There are issues with identity; a good examlpe is a hibernate proxy which makes it impossible to do a reference comparison, even though you get the guarantee that there are not multiple object instances of the same entity in a session.
My questions:
- What is the meaning of self call?
- Why we can not do a reference comparison when both refers to proxy object?