Proxy Pattern

In computer programming, the proxy pattern is a software design pattern.

A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate.

A well-known example of the proxy pattern is a reference counting pointer object.

In situations where multiple copies of a complex object must exist, the proxy pattern can be adapted to incorporate the flyweight pattern in order to reduce the application's memory footprint. Typically, one instance of the complex object and multiple proxy objects are created, all of which contain a reference to the single original complex object. Any operations performed on the proxies are forwarded to the original object. Once all instances of the proxy are out of scope, the complex object's memory may be deallocated.

Read more about Proxy Pattern:  Example

Famous quotes containing the word pattern:

    In this lucid and flexible pattern only one thing remained always stationary, but this fallacy went unnoticed by Martha. The blind spot was the victim. The victim showed no signs of life before being deprived of it. If anything, the corpse which had to be moved and handled before burial seemed more active than its biological predecessor.
    Vladimir Nabokov (1899–1977)