Skip to main content

Summary

Pattern Comparison

PatternWhen to ApplyStrengthsCaveatsCommon Use Cases
AdapterWhen the existing interface is incompatibleProvides a unified API to the callerAdapter can grow complex with heavy logicExternal APIs, legacy libraries, compatibility
FacadeWhen internal processes are too complexSimplifies APIs and combines multiple callsStructure differs from the real logicUI-facing APIs, subsystem integration
ProxyWhen inserting access control or caching logicFlexible interception (e.g. lazy, logging)Doesn’t transform behaviorCaching, authentication, request tracing

Choosing the Right Pattern

  • Connecting to a legacy or incompatible interface? → Use Adapter
  • Simplifying complex API calls? → Use Facade
  • Want to insert extra behavior (auth, cache)? → Use Proxy

Team Discussion Snippets

  • “This old API is unavoidable—let’s wrap it with an Adapter.”
  • “We should abstract it behind a unified interface so we can switch implementations later.”
  • “Calling .printText() directly everywhere feels risky—let’s add a transformation layer.”