Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Proxy pattern
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Overview== The Proxy <ref name="GoF">{{cite book|author=Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides|title=Design Patterns: Elements of Reusable Object-Oriented Software|year=1994|publisher=Addison Wesley|isbn=0-201-63361-2|pages=[https://archive.org/details/designpatternsel00gamm/page/207 207ff]|url-access=registration|url=https://archive.org/details/designpatternsel00gamm/page/207}}</ref> design pattern is one of the twenty-three well-known ''[[Design Patterns|GoF design patterns]]'' that describe how to solve recurring design problems to design flexible and reusable object-oriented software, that is, objects that are easier to implement, change, test, and reuse. ===What problems can the Proxy design pattern solve?=== Source:<ref>{{cite web|title=The Proxy design pattern - Problem, Solution, and Applicability|url=http://w3sdesign.com/?gr=s07&ugr=proble|website=w3sDesign.com|access-date=2017-08-12}}</ref> * The access to an object should be controlled. * Additional functionality should be provided when accessing an object. When accessing sensitive objects, for example, it should be possible to check that clients have the needed access rights. ===What solution does the Proxy design pattern describe?=== Define a separate <code>Proxy</code> object that * can be used as a substitute for another object (<code>Subject</code>), and * implements additional functionality to control the access to this subject. This makes it possible to work through a <code>Proxy</code> object to perform additional functionality when accessing a subject, like checking the access rights of clients accessing a sensitive object. To act as a substitute for a subject, a proxy must implement the <code>Subject</code> interface. Clients can't tell whether they work with a subject or its proxy. See also the UML class and sequence diagram below.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)