- Design patterns
- Structural patterns
Structural patterns
Patterns for putting objects together into larger structures that stay flexible.
7 guides84 min in totalDesign patterns
The guides, in order
Read them top to bottom: each one builds on the ones before. The ones you've read carry a check.
- Adapter Pattern: Fit a Third-Party SDK Into Your Own InterfaceLearn the Adapter pattern by wrapping a vendor SMS SDK behind the interface your code already uses, with TypeScript, Python and PHP examples.11 min readStart here
- Bridge Pattern: Split Abstraction from ImplementationLearn the Bridge pattern through a warehouse label system that keeps label types and printer drivers growing independently.12 min read
- Composite Pattern: Treat Single Items and Groups Through One InterfaceLearn the Composite pattern by building a cloud cost roll-up where single resources and nested groups answer the same questions through one tree interface.12 min read
- Decorator: Add Behaviour by Wrapping, the Way Middleware DoesLearn the Decorator pattern by stacking auth, caching and timing around an API handler that keeps the same interface, with TypeScript, Python and PHP code.13 min read
- Facade Pattern: One Simple Entry Point to a Messy SubsystemLearn the Facade pattern through a hotel check-in example, with TypeScript, Python and PHP code, trade-offs and interview questions.11 min read
- Flyweight Pattern: Share Immutable State Across Many ObjectsLearn the Flyweight pattern through a 68,000-seat arena map that shares seat types instead of copying them, with TypeScript, Python and PHP code.12 min read
- Proxy Pattern: Control Access with a Stand-In ObjectLearn the Proxy pattern through a hospital scan viewer that adds lazy connection, caching and access checks without touching the remote archive client.13 min read
About this group
- What you'll find
- Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy, each with a real case, such as wrapping a third-party SDK or stacking caching and retries.
- It's for you if…
- you need to integrate someone else's code or add behaviour without touching classes that already work.
- How each guide works
- Each guide explains the problem the pattern solves, the solution and an analogy, with a structure diagram and its participants. Then come when to apply it, how to implement it step by step, pros and cons, how it relates to other patterns and code in TypeScript, Python and PHP.