Proxy Pattern
  • is a type of structural design pattern that provides a surrogate or placeholder for another object to control access to it

Proxy Pattern - Types

  • Remote Proxy - local representative of remote object, hides remote calls (RPC/RMI/REST/etc)
  • Virtual (Lazy-Load) Proxy - lazy creation of expensive objects (real object is only created when a client first requests/accesses the object)
  • Access/Protective Proxy – control access to the sensitive object/subject
  • Smart Proxy - reference counting, caching, lazy DB loading

Real-World Example

Code Example

Comparisons

Resources