Looking at the UML diagram on wikipedia, both the proxy class and the subject class(es) implement the same interface.
From what I understand, the purpose of the proxy class is delegation. This can be done via composition; the delegated class(es) do not have to implement the same interface.
Is there a reason the subject class(es) have to implement the same interface as the proxy class?
Is there a reason the subject class(es) have to implement the same interface as the proxy class?
Yes but it's the other way around the proxy has to implement the same interface as the subject
The Client doesn't realize that the instance it is using is a proxy! The Client thinks it's a
Subject