Difference between revisions of "Proxy"

From CDOT Wiki
Jump to: navigation, search
Line 9: Line 9:
  
 
==Proxy Design Pattern==
 
==Proxy Design Pattern==
 +
 +
When a request is made to a Proxy, the real object is then instantiated and from then on any further requests are made to the real object. There are many situations in which a proxy pattern is required:
 +
 +
<ul>
 +
  <li><b>Remote Proxy</b> - provides a local representative that is located in a different
 +
      address space.</li>
 +
  <li><b>Virtual Proxy</b> - creates expensive objects only when that object's information is
 +
      required.</li>
 +
  <li><b>Protection Proxy</b> - provides access controls for different clients to a specified
 +
      target object.</li>
 +
  <li><b>Smart Reference Proxy</b> - performs additional actions when a specific object is
 +
      referenced such as counting the number of references, loading an object into memory when
 +
      first referenced, and checking that the object is locked before access so that no other
 +
      object may change it.</li>
 +
</ul>
 +
 
==Links==
 
==Links==
 
[[BTP600]]
 
[[BTP600]]
 
<br />
 
<br />
 
[http://en.wikipedia.org/wiki/Proxy_pattern Wikipedia article on the Proxy Pattern]
 
[http://en.wikipedia.org/wiki/Proxy_pattern Wikipedia article on the Proxy Pattern]

Revision as of 18:02, 16 January 2007

The Proxy pattern is used in software development to create a placeholder for an object. The object is not actually created until the information that the object holds is required. This extra layer of abstraction saves time when a program must access a database or a disk for the information.

If the information is never required, the database/disk will never be queried and the system will run more efficiently with less slowdowns for unnecessary materializations.

Proxy Design Pattern

When a request is made to a Proxy, the real object is then instantiated and from then on any further requests are made to the real object. There are many situations in which a proxy pattern is required:

  • Remote Proxy - provides a local representative that is located in a different address space.
  • Virtual Proxy - creates expensive objects only when that object's information is required.
  • Protection Proxy - provides access controls for different clients to a specified target object.
  • Smart Reference Proxy - performs additional actions when a specific object is referenced such as counting the number of references, loading an object into memory when first referenced, and checking that the object is locked before access so that no other object may change it.

Links

BTP600
Wikipedia article on the Proxy Pattern