← Back to design patterns map
🛡️
Design Pattern

Proxy

Use a stand-in object to control access to the real object.

structural

Visual Diagram

Client
-> Proxy checks auth/cache/rate
-> Real service

When To Use

  • ->Caching expensive service calls
  • ->Checking authorization before access
  • ->Lazy loading heavy objects
  • ->Rate limiting external calls
Used in: JavaScript Proxy, ORM lazy loading, caching proxy
proxy.js

Live Editor

Loading...

Output

Run code to see output...