api: YAML JSON TOON Database version: 1.0.0 format: toon category: id: 394 slug: design-patterns name: Design Patterns description: Software design patterns with descriptions and use cases. icon: box created_at: 1783090350 dataset_count: 8 topic: overview: "Design-pattern reference data names the recurring solutions to recurring software-design problems: the creational, structural and behavioral patterns of the 'Gang of Four', the concurrency patterns that coordinate threads, the architectural patterns that shape whole systems, the SOLID principles behind them and the anti-patterns that come from misusing them. Patterns are vocabulary first and templates second: their value is that 'use a strategy here' conveys a design in four words. They also carry costs, since applying a pattern where a simple function would do adds indirection, so each entry states when to use it as well as what it is." key_ideas[7]{term,meaning}: "Creational, structural, behavioral","The three Gang of Four groups: patterns for creating objects, for composing them and for assigning responsibilities and communication." Coupling and cohesion,Coupling is how much modules depend on one another; cohesion is how focused each module is. Good designs reduce the first and increase the second. Program to an interface,Depend on abstractions rather than concrete classes so implementations can change without affecting callers. SOLID,"Five object-oriented principles: single responsibility, open/closed, Liskov substitution, interface segregation and dependency inversion." Composition over inheritance,"Build behavior by combining objects instead of extending class hierarchies, which keeps designs flexible." Anti-pattern,"A common response to a problem that looks reasonable but causes more trouble than it solves, such as the God Object." Architecture vs design pattern,"Architectural patterns (microservices, MVC) shape a whole system; design patterns (observer, factory) shape a few collaborating classes." pitfalls[4]: "Applying patterns by reflex. If a plain function or a simple class solves the problem, the pattern adds only complexity.",Using Singleton as global state; it hides dependencies and makes testing harder.,Treating the pattern's textbook structure as mandatory; adapt it to the language (closures can replace many pattern classes).,"Naming a pattern incorrectly; a decorator is not a proxy, even though both wrap an object." agent_tips[3]: "Name the pattern, state the problem it solves, show the minimal structure and note the main trade-off.","Recommend the simplest design that works, and name the pattern only when it clarifies communication.",Match the example to the user's language and idioms; functional languages often express these patterns with functions. start_with[2]: solid-principles,creational-patterns datasets[8]{id,slug,title,description,tags,view_count,created_at,entry_count,summary}: 2731,architectural-design-patterns,Architectural Design Patterns,"High-level structural patterns: MVC, MVVM, Microservices, Event-Driven, Layered, Hexagonal (Ports & Adapters), CQRS, Serverless, Service Mesh.","design-patterns,architectural,mvc,microservices,event-driven,serverless",53,1777673262,9,"System-level architectural patterns: MVC, MVVM, microservices, event-driven, layered, hexagonal and CQRS, each with category, description, key principles, benefits, trade-offs, typical components, when to use it and technology examples." 2737,behavioral-design-patterns,Behavioral Design Patterns,"Patterns for communication between objects: Observer, Strategy, Command, Iterator, State, Template Method, Visitor, Mediator, Chain of Responsibility, Interpreter.","design-patterns,behavioral,observer,strategy,command,state",63,1777673262,10,"Behavioral design patterns that assign responsibilities and manage communication: Observer, Strategy, Command, Iterator, State, Template Method, Visitor, Mediator, Chain of Responsibility and Interpreter, each with intent, structure, uses, pros, cons and related patterns." 2755,concurrency-design-patterns,Concurrency Design Patterns,"Patterns for multi-threaded programming: Producer-Consumer, Reader-Writer, Thread Pool, Future/Promise, Reactor, Monitor, Scheduler.","design-patterns,concurrency,multithreading,producer-consumer,thread-pool",48,1777673262,7,"Concurrency patterns for coordinating threads and tasks: producer-consumer, reader-writer locks, thread pools, futures and promises, the reactor pattern, monitors and schedulers, each with problem, solution, components, benefits, pitfalls and language examples." 2767,creational-patterns,Creational Design Patterns,"Patterns for object creation: Singleton, Factory Method, Abstract Factory, Builder, and Prototype with intents and use cases.","design patterns,oop,software engineering",61,1777673262,8,"Creational design patterns that control how objects are created: Singleton, Factory Method, Abstract Factory, Builder and Prototype, plus Object Pool, Lazy Initialization and Dependency Injection, each with intent and when to use it." 2883,reliable-background-jobs,Reliable Background Job Patterns,"Queue and worker design patterns for duplicate deliveries, failure recovery, concurrency, and bounded work.","design-patterns,reliable background jobs,reference,engineering",65,1791798640,10,"Queue and worker design patterns for duplicate deliveries, failure recovery, concurrency, and bounded work. Each row includes a practical application and a failure to check before using it." 2896,solid-principles,SOLID Principles,Five design principles for writing maintainable object-oriented code.,"design-patterns,solid,oop,software-engineering",37,1793403093,12,"The five SOLID principles of object-oriented design with a description and an example each, followed by related design principles: DRY, KISS, YAGNI, the Law of Demeter, composition over inheritance, separation of concerns and Tell, Don't Ask." 2781,design-pattern-anti-patterns,Software Anti-Patterns & Design Pattern Misuse,"Common software design anti-patterns, misuse of design patterns, code smells indicating trouble, and refactoring strategies to fix them.","anti-patterns,code-smells,refactoring,software-design,bad-practices,technical-debt",51,1777673262,8,"Common software anti-patterns and design-pattern misuse with aliases, symptoms, root cause, consequences, refactoring and related patterns: God Object, Singleton overuse, spaghetti code, golden hammer, premature optimization, copy-paste programming, lava flow and big ball of mud." 2908,structural-patterns,Structural Design Patterns,"Structural design patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy with intents and when-to-use guidance.","design patterns,oop,software engineering,structure",71,1777673262,7,"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."