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:
“It was her stern necessity: all things
Are of one pattern made; bird, beast, and flower,
Deceive us, seeming to be many things,
And are but one. Beheld far off, they differ
As God and devil; bring them to the mind,
They dull its edge with their monotony.”
—Ralph Waldo Emerson (18031882)