• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Protection Proxy Pattern

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the GoG book describes the proxy as a class (call it P) that extends an abstract class(i assume "or implement an interface") (call it A) to provide actual access to another object of a class (call it B) that extends the same abstract class.
that maens that the P will provide the same exact methods B provides.

now if i am trying to hide some methods of B by using the protection proxy, i can't see how i can do that because P will provide the same methods.

I know that Adapter pattern provides what I want to accopmlish (hding methods) BUT what is a then protection proxy is ?
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Musab,

The Adapter an the Proxy patterns differ in that the proxy has the same interface as the proxied class whilst the adapter has a different interface.

A Protection Proxy is used to manage access to the proxied class's methods, by user for example. I don't think you'll need a protection proxy for this assignment as every user can access all the application's functionality.

Jar
 
reply
    Bookmark Topic Watch Topic
  • New Topic