Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Protection Proxy Pattern

 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • 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 ?
 
Jar Jaquiso
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic