Markus 5ce932ceb7 Work on #213
- properly categorize all patterns
- remove pattern list from readme
- minor fixes to readme
- removed "introduction" because its not a pattern and an error i
committed some time ago
2015-08-20 21:40:07 +02:00

1.1 KiB

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Proxy proxy /patterns/proxy/ Structural Java

Intent: Provide a surrogate or placeholder for another object to control access to it.

alt text

Applicability: Proxy is applicable whenever there is a need for a more versatile or sophisticated reference to an object than a simple pointer. Here are several common situations in which the Proxy pattern is applicable

  • a remote proxy provides a local representative for an object in a different address space.
  • a virtual proxy creates expensive objects on demand.
  • a protection proxy controls access to the original object. Protection proxies are useful when objects should have different access rights.

Typical Use Case:

  • control access to another object
  • lazy initialization
  • implement logging
  • facilitate network connection
  • to count references to an object

Real world examples: