Knowledge Guide
HomeOO & Low-Level DesignDesign Patterns Overview

Summary (2)

For quick reference, the following table offers a thorough analysis of the distinctive characteristics, applicability, examples, benefits, and drawbacks of each structural design pattern.

Pattern NameDistinctive FeatureApplicabilityAn ExampleProsCons
AdapterBridges incompatibilities between interfacesWhen you want to use an existing class whose interface is not compatible with the rest of the codePower adapter for different plug typesEnables interoperability of interfaces; reusableIncreases overall complexity of the code
CompositeRepresents part-whole hierarchies of objectsWhen you want to treat individual objects and compositions of objects uniformlyGraphic drawing editor handling shapes and groups of shapesSimplifies client code; easier management of objectsDesign can become overly generalized
ProxyProvides a placeholder for another object to control access to itLazy loading, logging, access control, smart referenceInternet proxy server controlling access to web contentControl object access; reduce cost of expensive operationsCan introduce a level of indirection; may impact performance
FlyweightMinimizes memory usage by sharing as much data as possible with similar objectsWhen dealing with large numbers of similar objects with little variation in stateCharacters in a word processorReduces memory usage; efficient data sharingComplexity; managing shared state
BridgeSeparates an object’s abstraction from its implementationWhen you want to avoid a permanent binding between an abstraction and its implementationDifferent UI platforms with different backend renderersAbstraction and implementation can vary independently; scalabilityIncreased complexity; conceptual overhead
DecoratorAdds responsibilities to objects dynamicallyWhen extending capabilities of a class in runtimeAdding scrolling to a text view dynamicallyMore flexible than subclassing; avoid feature-loaded classesCan lead to complex code structure; hard to debug
FacadeProvides a simplified interface to a complex subsystemWhen there's a complex system and you want to provide a simple interface to itHome theater control systemSimplifies interface; reduces dependencies on outside codeCan become a single point of failure; may limit flexibility
🤖 Don't fully get this? Learn it with Claude

Stuck on Summary (2)? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Summary (2)** (OO & Low-Level Design) and want to truly understand it. Explain Summary (2) from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Summary (2)** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Summary (2)** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Summary (2)** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes