Is this the proxy pattern? I have a interface called DataIntf which has all of the public methods of the Data class. This interface is extended by my RemoteDataIntf interface, which also extends Remote. My remote implementation implements this interface. The subclass of Data implements this interface as well. On the client I use a factory that contains one method getConnection which returns an implementation of the DataInt interface. It will either return the remote implementation or the local, which is the subclass of the Data class. The client will make calls to this implementation. Is this considered the proxy pattern or do I have to have another class that is client specific and contains an instance of the subclass of Data and delegates all of the calls to the instance? Replies are greatly appreciated! Rama Ituarte
Hi Rama, Sounds like a proxy to me. According to Design Patterns, the Proxy pattern consists of a Subject which defines an interface (in your case DataIntf), a Proxy which implements that interface (your implementation of the DataInt interface) and a RealSubject which also implements the interface (this would be Data). So I would say you could safely call it a Proxy pattern. Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Joined: Apr 10, 2002
Thank you very much Michael! I really appreciate your time. Have a good day.