api: YAML JSON TOON Database version: 1.0.0 format: toon dataset: id: 2908 slug: structural-patterns title: Structural Design Patterns description: "Structural design patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy with intents and when-to-use guidance." summary: "Structural design patterns that compose classes and objects into larger structures: Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy, each with intent and when to use it." use_when[2]: "You need to wrap, combine or simplify existing components.","You are comparing Adapter, Decorator, Proxy and Facade." caveats[2]: "Adapter, Decorator and Proxy all wrap an object; they differ in intent (convert, extend, control access).",Each layer of wrapping adds indirection and can make debugging harder. related[4]: creational-patterns,behavioral-design-patterns,solid-principles,architectural-design-patterns entry_count: 7 fields[3]{section,field,type,example}: patterns,name,string,Adapter patterns,intent,string,Convert interface of one class to another expec… patterns,when_to_use,string,"Integrating incompatible interfaces, legacy cod…" category: Design Patterns category_slug: design-patterns tags: "design patterns,oop,software engineering,structure" view_count: 55 created_at: 1777673262 updated_at: 1777673262 data: patterns[7]{name,intent,when_to_use}: Adapter,Convert interface of one class to another expected by clients,"Integrating incompatible interfaces, legacy code wrapper" Bridge,Decouple abstraction from implementation so they vary independently,When both abstraction and implementation need extensibility Composite,Compose objects into tree structures to represent part-whole hierarchies,"Tree structures, recursive composition, uniform treatment" Decorator,Attach additional responsibilities to an object dynamically,"Adding behavior without subclassing, open/closed principle" Facade,Provide a unified interface to a set of interfaces in a subsystem,"Simplifying complex subsystems, entry point abstraction" Flyweight,Share objects to support large numbers of fine-grained objects efficiently,"Memory optimization, many similar objects" Proxy,Provide a surrogate or placeholder for another object to control access,"Lazy loading, access control, logging, remote objects"