Software Design

Proxy Pattern: Lazy-Loading Heavy Media Assets

UML Class Diagrams · made in Skemio

UML class diagram showing an Image interface implemented by ProxyImage and HighResImage. ProxyImage contains a reference to HighResImage, delaying its instantiation.
UML class diagram showing an Image interface implemented by ProxyImage and HighResImage. ProxyImage contains a reference to HighResImage, delaying its instantiation.

What it shows

  • Defers high-cost disk or network I/O until the display method executes.
  • Both client and proxy implement the same interface for seamless swaps.
  • Guards memory limits by caching loaded references or evicting on idle.

The takeaway

Use a proxy to keep object instantiation cheap and defer expensive I/O until access.

More uml class diagrams