• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question regarding Proxy DP

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have an abstract class let say "Parent" which
implements interface "Clientservice" has some methods
"init()"
"processRequest()"
"Destroy()"

Now i want to have a proxy class for each concret subclass class of "Parent".
I need proxy for each subclass becuase i do not want Client to intract my logical subclasses directly so i need a proxy for each class becuase proxy may contains some of its own logic (which may change) but for client the basic opertation such as "init" "ProcessRequest(.....)" "destroy()" or in future they may be increase(for all subclasses)
which i can do by adding one or more methods in "Client services" interface.
i was woundering would it be ok if i implement "clientservice" interface in proxy class also.
ofcourse proxy will not contain the logical implementation rather providing a same interface to call actual class method.
???
client will one use method which are in "clintservices" interface through Proxy.

is that ok to do?
" can proxy implements the same interface as its surrogated class which it is holding
by doing this it would allow Proxy class to sync with its holding class interms of fuctions client needs to call on holding class"

if any of you understand what i am tring to ask then please comment some thing.

at
thanks.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say that yes, the proxy class MUST implement all of the interfaces its wrapped class implements (at least if these are publicly accessibly methods that external clients will call).
Kyle
 
Atif Shah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks
Kyle
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic