• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Is this the proxy pattern?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rama Ituarte
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Michael! I really appreciate your time.
Have a good day.
 
Not so fast naughty spawn! I want you to know about
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic