1. Home
  2. Explore
  3. Computer Science
  4. Design Patterns Review

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Design Patterns Review

Design Patterns — Comprehensive Study Notes

1. Origins and Purpose of Design Patterns

Christopher Alexander and the Pattern Movement

The design-pattern movement began in the field of architecture, not software engineering. Architect Christopher Alexander introduced the idea that recurring problems can have recurring, reusable solutions. His work established the conceptual foundation for describing patterns.

A pattern is not merely a solution. It captures design experience: a problem that occurs repeatedly, the forces that make the problem difficult, a reusable solution, and the consequences of applying that solution.

The pattern movement later spread to:

  • Software development

  • Software architecture

  • Hardware development

  • Organizational and social systems

  • Other domains in which recurring problems and solutions can be identified

The Gang of Four

The most influential software-design-pattern book is Design Patterns: Elements of Reusable Object-Oriented Software, written by the Gang of Four:

  • Erich Gamma

  • Richard Helm

  • Ralph Johnson

  • John Vlissides

The book collected and organized reusable object-oriented design knowledge from multiple authors and pattern communities. Many of the classical design patterns used in software engineering come from this work.

Another major source of patterns is the Pattern-Oriented Software Architecture series, commonly abbreviated as POSA. These books focus particularly on architectural patterns, concurrent systems, communication, distributed systems, and other large-scale software concerns.

A design pattern documents proven design knowledge so that developers can reuse solutions instead of repeatedly solving the same design problem from scratch.


2. What Is a Design Pattern?

A design pattern is a proven solution idea or solution template for a recurring design problem.

A complete definition includes several important characteristics:

  • The problem occurs repeatedly.

  • The situation is nontrivial and requires a design decision.

  • The solution has been applied successfully multiple times.

  • The pattern describes the underlying design idea rather than one concrete implementation.

  • The pattern includes both advantages and disadvantages.

A pattern is therefore more than an isolated programming trick or an untested suggestion. A single proposed solution is not necessarily a pattern until experience demonstrates that it works repeatedly in appropriate contexts.

Patterns Versus Concrete Implementations

A design pattern does not usually specify every class, method, data structure, or line of code. Instead, it explains:

  • Which responsibilities should exist

  • Which objects or classes should collaborate

  • How those collaborators should interact

  • Which trade-offs result from the design

Different programming languages can implement the same pattern in different ways. The pattern is therefore generally independent of programming language.

A language-specific solution is often called an idiom. Idioms solve smaller problems using features or conventions of a particular language.

Examples include:

  • Language-specific resource-management techniques

  • A Python module-entry idiom such as if __name__ == "__main__":

  • Language-specific ways of implementing iterators or smart pointers


3. The Structure of a Pattern

A pattern is commonly described using several interconnected parts.

Pattern Name

The name is a short, memorable label such as:

  • Adapter

  • Broker

  • Decorator

  • Active Object

  • Strategy

A good name provides a shared vocabulary. Developers can discuss a design problem efficiently by referring to a known pattern rather than describing the entire structure each time.

Context

The context explains the situation in which the pattern is applicable.

Patterns can exist in many fields, so the context clarifies the domain and circumstances. A software-development pattern should not automatically be applied to unrelated domains or situations.

In software, the context may involve:

  • Embedded systems

  • Distributed systems

  • Object-oriented applications

  • Resource-constrained devices

  • Concurrent systems

  • User-interface applications

Problem

The problem describes what must be solved. A useful pattern problem is not trivial or obvious. It involves a difficult design situation that requires balancing competing concerns.

Forces

The forces are the constraints, pressures, and competing requirements that make the problem difficult.

Typical forces include:

  • Limited memory

  • Limited processor capacity

  • Energy restrictions

  • Communication overhead

  • Need for flexibility

  • Need for performance

  • Need for maintainability

  • Need to support future extensions

  • Conflicting requirements between simplicity and configurability

For example, an embedded system may need a flexible architecture but have very limited memory and processing power. These constraints influence which solution is feasible.

Solution

The solution gives a generic description of how the problem can be addressed. It normally includes both a static and a dynamic view.

Static Structure

The static part describes:

  • The classes or objects involved

  • Their responsibilities

  • Their relationships

  • The interfaces they provide

Dynamic Behavior

The dynamic part describes:

  • How objects interact at runtime

  • Which object calls which other object

  • How messages or data flow through the system

  • How objects are created and connected

  • How control moves between components

Consequences

The consequences describe the results of applying the pattern. These include both benefits and liabilities.

Benefits may include:

  • Better flexibility

  • Lower coupling

  • Easier extension

  • Improved reuse

  • Clearer separation of responsibilities

  • Avoidance of common design mistakes

Liabilities may include:

  • Additional classes and objects

  • More complicated control flow

  • Communication overhead

  • Increased memory consumption

  • More configuration

  • Reduced performance

  • Greater implementation complexity

A design pattern is not universally good. Its consequences must be evaluated against the requirements of the particular system.

Known Uses

Known uses are real examples in which the pattern has been applied successfully. They demonstrate that the pattern is not merely theoretical.

Repeated successful use provides the empirical basis for recognizing a design as a pattern.


4. The Pattern-House Metaphor

The components of a pattern can be remembered using a house metaphor:

  • Roof: The context in which the pattern applies

  • Interior: The problem and its forces

  • Foundation or central structure: The solution

  • Resulting structure: The consequences

  • Underlying ground: Known uses and accumulated experience

  • Name: The label that identifies the pattern

These parts are related:

  1. The context establishes the situation.

  2. The problem identifies what must be solved.

  3. The forces explain why the problem is difficult.

  4. The solution addresses the problem and balances the forces.

  5. The consequences describe the resulting trade-offs.

  6. Known uses show that the solution has worked in practice.


5. Major Categories of Design Patterns

The categories below are useful for organizing patterns, although the classification is partly artificial. Some patterns could reasonably belong to more than one category.


6. Wrapping Patterns

Wrapping patterns place an additional abstraction layer around an existing object, interface, or subsystem.

Wrapping can be used to:

  • Adapt an incompatible interface

  • Control access

  • Add behavior

  • Simplify a complicated subsystem

Adapter

The Adapter converts the interface of an existing class or object into an interface expected by its client.

It is useful when:

  • An existing component provides useful functionality.

  • Its interface does not match the interface required by the rest of the system.

  • Modifying the existing component is undesirable or impossible.

The adapter allows incompatible components to collaborate without changing their original implementations.

Proxy

The Proxy provides a substitute or representative for another object.

A proxy can control access to the real object and may be used for:

  • Remote access

  • Lazy creation

  • Access control

  • Caching

  • Logging

  • Synchronization

The client communicates with the proxy as though it were using the original object.

Decorator

The Decorator dynamically adds responsibilities or behavior to an object without modifying its class.

It is useful when:

  • Behavior must be added flexibly.

  • Multiple combinations of features are possible.

  • Subclassing would produce too many classes.

  • Behavior should be added or removed at runtime.

Decorators wrap objects while preserving a compatible interface.

Facade

The Facade provides a simplified interface to a complex subsystem.

It hides unnecessary implementation details and gives clients a smaller, easier-to-use entry point. The subsystem remains available internally, but clients do not need to understand all of its classes and interactions.


7. Creational Patterns

Creational patterns address object creation. They are useful when object construction is complicated, variable, or should be separated from application logic.

Builder

The Builder separates the construction of a complex object from its final representation.

Construction occurs through multiple steps. This allows:

  • Different representations to be created using similar construction processes

  • Complex creation logic to be organized clearly

  • Optional components to be configured

  • Object construction to be separated from the object’s use

The Builder is especially useful when an object cannot be created conveniently through one constructor call.

Prototype

The Prototype creates new objects by copying an existing object used as a template.

It is useful when:

  • Object creation is expensive.

  • The exact types of objects are determined at runtime.

  • New types should be introduced without changing creation code.

  • A preconfigured object can serve as a starting point for new objects.

A prototype can allow objects or configurations to be created dynamically.

Singleton

The Singleton ensures that a class has only one instance and provides a controlled way to access it.

The pattern takes responsibility for:

  • Preventing multiple instances

  • Managing the single instance

  • Providing access to that instance

The pattern can be appropriate when exactly one shared resource or coordination object is required. However, a Singleton can also introduce global state and hidden dependencies, so its consequences must be considered carefully.


8. Behavioral Patterns

Behavioral patterns focus on the behavior, communication, and responsibilities of objects. They describe how objects collaborate and how behavior can change.

Strategy

The Strategy pattern encapsulates an algorithm behind an abstraction.

It allows:

  • Different algorithms to be selected through a common interface

  • Algorithms to be exchanged at runtime

  • Clients to use an algorithm without implementing its details

  • Algorithm implementations to vary independently from the client

Strategy is useful when a system must support multiple ways of performing an operation.

Command

The Command pattern encapsulates a request, operation, or method call as an object.

A command object can contain:

  • The operation to perform

  • The receiver that performs it

  • The required parameters

  • The execution logic

This enables requests to be:

  • Stored

  • Queued

  • Passed between components

  • Executed later

  • Logged

  • Undone or replayed

Command is particularly useful when an operation must be treated as data.

State

The State pattern changes an object’s behavior when its internal state changes.

It is especially appropriate when an object can be modeled as a state machine:

  • The object has a set of possible states.

  • Its response depends on its current state.

  • Transitions move it from one state to another.

  • The same request may produce different actions in different states.

The State pattern prevents large conditional structures from becoming the central mechanism for state-dependent behavior. Instead, each state can encapsulate the behavior appropriate to that state.

Iterator

The Iterator provides a way to access elements of a collection sequentially without exposing the collection’s internal representation.

It separates:

  • The collection’s internal storage structure

  • The mechanism used to traverse the collection

Different programming languages implement iteration differently, but the general design idea is the same: clients can traverse a collection through a consistent abstraction.

Chain of Responsibility

The Chain of Responsibility passes a request through a sequence of possible handlers.

Each handler can:

  • Process the request

  • Pass it to the next handler

  • Decide that it cannot handle it

This reduces direct coupling between the sender and the specific receiver of a request.

Interpreter

The Interpreter represents the grammar of a language and provides a mechanism for interpreting sentences in that language.

It is useful when:

  • A small language or notation must be evaluated.

  • Expressions follow a well-defined grammar.

  • The system needs to interpret user-defined commands or expressions.

The Interpreter is closely related to an abstract syntax tree, which represents the syntactic structure of an expression.


9. Architectural Patterns

Architectural patterns influence the overall structure of an application or system. They affect many components rather than only one class or method.

Layers

The Layers pattern organizes a system into levels, where each layer has a particular responsibility and generally communicates with adjacent layers.

Typical advantages include:

  • Separation of concerns

  • Easier maintenance

  • Replaceability of individual layers

  • Clearer dependencies

A layer should generally use services of lower layers without depending unnecessarily on higher layers.

Broker

The Broker pattern supports communication between distributed components.

A broker mediates between:

  • Clients

  • Servers or service providers

  • Communication mechanisms

  • Registration and discovery processes

The client does not need to communicate directly with the server. This decouples clients and services and can support distributed systems.

Potential liabilities include:

  • Communication overhead

  • Additional infrastructure

  • Need for registration and discovery

  • Complexity in locating services

  • Dependence on broker processes

  • Potential performance costs

The Broker pattern should not be used everywhere. It is appropriate when its benefits for distribution and decoupling justify its overhead.

Master-Slave

The Master-Slave pattern assigns coordination responsibility to a master and delegates work to one or more slaves.

The master typically:

  • Distributes tasks

  • Coordinates execution

  • Collects results

  • Manages the overall process

The slaves perform assigned work, often independently or in parallel.

Client-Server

The Client-Server pattern divides a system into:

  • Clients, which request services

  • Servers, which provide services

This separates service users from service providers and supports centralized service management and distribution.

Pipes and Filters

The Pipes and Filters pattern organizes processing as a sequence of independent filters connected by pipes.

  • A filter transforms or processes data.

  • A pipe transfers data between filters.

This design supports:

  • Reusable processing stages

  • Independent development of filters

  • Flexible rearrangement of processing steps

  • Streaming and incremental processing

Model-View-Controller

Model-View-Controller, or MVC, separates an application into three conceptual roles:

  • Model: Represents data and domain logic.

  • View: Presents information to the user.

  • Controller: Receives input and coordinates actions.

MVC separates responsibilities and establishes a controlled flow of data and behavior. It prevents the user interface, domain data, and input-handling logic from becoming tightly mixed.

Although MVC is sometimes classified as a communication pattern, its more central purpose is the separation of responsibilities between model, view, and controller.


10. Communication and Coordination Patterns

Communication patterns regulate how objects exchange information and how senders and receivers are coupled.

Message-Based Communication

A message can encapsulate information that is sent from one object or component to another. This message may travel:

  • Within a process

  • Between objects

  • Across machines

  • Over a network

Message-based designs can reduce direct dependencies between sender and receiver.

Mediator

The Mediator centralizes communication between a group of objects.

Instead of every object communicating directly with every other object, objects communicate through the mediator. This can:

  • Reduce the number of direct connections

  • Centralize coordination logic

  • Simplify individual components

The trade-off is that the mediator may become complex or overly responsible if too much behavior is centralized.

Observer

The Observer pattern establishes a one-to-many dependency:

  • One object acts as the subject or publisher.

  • Multiple observers register interest.

  • When the subject changes, observers are notified.

This supports event-driven communication and decouples the subject from the specific observer implementations.

However, the pattern can create performance problems. If a single change causes millions of observers to be notified synchronously, the application may become very slow. Notification strategy, timing, and the number of observers must therefore be considered.

Broker and Observer Compared

  • Broker: Primarily supports communication between distributed clients and services.

  • Observer: Primarily supports notification of dependent objects about a change.

  • Mediator: Primarily centralizes communication and coordination among related objects.

The correct choice depends on the communication requirements and the consequences that the system can tolerate.


11. Concurrency Patterns

Concurrency patterns structure systems in which multiple activities execute at the same time or appear to execute simultaneously.

Locks

A lock controls access to shared data or resources.

A thread or task acquires a lock before entering a critical section and releases it afterward. This prevents conflicting concurrent operations.

Locks can protect correctness, but they may also introduce:

  • Waiting

  • Deadlocks

  • Reduced parallelism

  • Priority problems

  • Complex synchronization logic

Monitor

A Monitor combines:

  • Shared data

  • Operations on that data

  • Mutual exclusion

  • Coordination or waiting mechanisms

Only one activity can execute protected monitor operations at a time. Monitors provide a structured approach to protecting shared state.

Active Object

The Active Object separates method invocation from method execution.

A client submits a request, and the active object processes it independently, often through its own thread or activity. This can:

  • Decouple callers from execution

  • Support asynchronous processing

  • Improve responsiveness

  • Organize concurrent operations

Future

A Future represents the eventual result of an asynchronous computation.

A caller can initiate an operation and receive a placeholder for its future result. The result can be retrieved later, allowing other work to continue in the meantime.

Scoped Locking

Scoped locking ties acquisition and release of a lock to a well-defined scope.

When execution enters the scope, the lock is acquired. When execution leaves the scope, the lock is released automatically or systematically, including when an error occurs.

This reduces the chance of forgetting to release a lock.

Async/Await

async and await provide language-level support for asynchronous operations.

  • async identifies an operation that may execute asynchronously.

  • await allows code to wait for a result without necessarily blocking the entire execution environment.

These mechanisms make asynchronous control flow easier to express and understand.


12. Resource-Management Patterns

Resource patterns address the acquisition, use, and release of resources.

Resources may include:

  • Memory

  • Files

  • Database connections

  • Network connections

  • Locks

  • Operating-system handles

  • External devices

A central concern is preventing resources from remaining allocated after they are no longer needed.

Garbage Collection

Garbage collection automatically identifies and reclaims memory that is no longer reachable by the program.

It reduces the need for explicit memory release and helps prevent certain memory leaks. However, it does not automatically manage every external resource, such as files, network connections, or locks.

Leasing

Leasing grants temporary ownership or access to a resource for a specified period or under defined conditions.

When the lease expires or is explicitly returned, the resource can be reclaimed or reassigned. Leasing is useful when resources must be shared or recovered even if a client fails to release them correctly.

Scoped Resources

A scoped resource is acquired and released within a clearly defined scope.

The resource’s lifetime is bounded by that scope, making it easier to guarantee cleanup. This is commonly used for:

  • File access

  • Locks

  • Database transactions

  • Temporary allocations

Smart Pointer

A smart pointer manages the lifetime of a dynamically allocated object automatically or semi-automatically.

A reference-counting smart pointer tracks how many references point to an object. When the count reaches zero, the object can be deleted because no component still needs it.

The pattern removes the burden of manually releasing objects, but reference cycles and ownership semantics must still be considered.


13. Additional Patterns

Some patterns do not fit neatly into a single major category but remain important.

Memento

The Memento captures and stores an object’s internal state so that it can be restored later without exposing the object’s implementation details.

It is useful for:

  • Undo operations

  • Checkpoints

  • State restoration

  • Transaction rollback

The object whose state is saved remains responsible for interpreting and restoring that state.

Composite

The Composite treats individual objects and compositions of objects uniformly.

It is useful for tree structures in which:

  • A leaf represents an individual object.

  • A composite represents a group containing other objects.

  • Both expose a common interface.

This allows clients to work with a single object or an entire hierarchy through the same abstraction.

In some architectural literature, the same general idea may be described as a whole-part structure.

Reflection

Reflection allows a program to inspect information about classes and objects at runtime.

Reflection may be used to discover:

  • Available methods

  • Attributes or fields

  • Object types

  • Metadata

  • Other structural information

It is useful for frameworks, serialization, dependency injection, debugging, and dynamic configuration, although it may introduce complexity or performance costs.

Extension Interface

An Extension Interface allows an object to provide different interfaces depending on the client’s needs.

A simple client can use a basic interface, while an advanced client can request a more detailed interface with additional configuration or operations. This prevents every client from being forced to deal with unnecessary complexity.

Half-Sync/Half-Async

The Half-Sync/Half-Async pattern separates asynchronous and synchronous processing.

  • The asynchronous portion handles events or requests without blocking.

  • The synchronous portion performs operations in a more controlled, sequential manner.

  • A queue or coordination mechanism connects the two portions.

This pattern is useful when systems must respond asynchronously while still using synchronous processing internally.


14. SOLID Principles

The SOLID principles guide object-oriented design and frequently appear behind successful design patterns.

Single Responsibility Principle

The Single Responsibility Principle states that a class should have one primary responsibility and therefore one main reason to change.

A class that handles multiple unrelated responsibilities becomes difficult to maintain because a change in one concern can affect the others.

Benefits include:

  • Smaller, clearer classes

  • Easier testing

  • Reduced coupling

  • More localized changes

Open-Closed Principle

The Open-Closed Principle states that software entities should be:

  • Open for extension

  • Closed for modification

New behavior should be added without repeatedly changing stable existing source code.

Patterns such as Strategy and State can support this principle. For example, a state machine can receive new state or transition configurations without requiring changes to the core state-machine implementation.

Liskov Substitution Principle

The Liskov Substitution Principle states that an object of a derived class should be usable wherever an object of its base class is expected without breaking correctness.

Subtypes must preserve the behavioral expectations established by their base types. In modern programming languages, polymorphism often makes the substitution mechanism convenient, but correct behavioral substitution still depends on sound design.

Interface Segregation Principle

The Interface Segregation Principle recommends using several focused interfaces rather than one large interface that forces clients to depend on operations they do not need.

A client should receive only the capabilities relevant to its role.

A related design goal is:

Interfaces should be easy to use correctly and difficult to use incorrectly.

Benefits include:

  • Fewer unnecessary dependencies

  • Clearer client expectations

  • Easier implementation

  • Reduced impact of interface changes

Dependency Inversion Principle

The Dependency Inversion Principle recommends that high-level components depend on abstractions rather than concrete implementations.

Instead of directly depending on a specific concrete class, a component can depend on:

  • An interface

  • An abstract class

  • Another stable abstraction

This allows different implementations to be substituted and supplied by other developers or components.

Dependency inversion supports:

  • Lower coupling

  • Greater flexibility

  • Easier testing

  • Independent replacement of implementations

  • Configuration at runtime or assembly time


15. General Principles of Good Programming

Decomposition

Decomposition breaks a large, complicated problem into smaller problems that can be solved individually.

The process is:

  1. Identify the overall problem.

  2. Divide it into smaller tasks.

  3. Divide difficult tasks further if necessary.

  4. Solve the smaller tasks.

  5. Integrate the results into a complete solution.

Decomposition applies both to software and to large intellectual projects such as a thesis or research problem.

Abstraction

Abstraction hides unnecessary detail and exposes only what clients need.

For example, an application developer sending a message over a network normally does not need to understand every detail of the underlying network frames or protocol headers. A higher-level abstraction provides a simpler way to use the communication system.

Patterns such as Adapter, Proxy, Facade, and related wrapping patterns use abstraction to reduce complexity.

Decoupling

Decoupling reduces direct dependencies between components.

A decoupled system allows decisions to be postponed and components to be connected later, often during configuration or runtime. Interfaces and abstractions help components communicate without knowing each other’s concrete implementations.

Benefits include:

  • Easier replacement of components

  • Reduced recompilation after changes

  • Better reuse

  • Greater flexibility

  • Easier testing and maintenance

Reusability

Reusability means that components, abstractions, or solutions can be used in multiple contexts rather than being rewritten for every project.

Design patterns promote reuse primarily at the level of design knowledge. They help developers reuse proven structures and avoid reinventing common solutions.

Simplicity

A good design should remain as simple as the requirements allow.

Developers should:

  • Implement what is currently needed.

  • Anticipate reasonable future changes.

  • Avoid building unnecessary flexibility.

  • Avoid premature optimization.

  • Avoid introducing patterns only for appearance or complexity.

Overengineering occurs when a solution contains abstractions, configuration, or patterns that the problem does not justify.

Patterns should be applied where they solve a real recurring problem, not automatically in every program. A simple script or “Hello, World” application generally does not benefit from a complex pattern architecture.

Consistency with the Context

Code should follow the conventions of its programming language, project, organization, and development environment.

Developers should respect:

  • Local naming conventions

  • Formatting and style rules

  • Common language idioms

  • Project architecture

  • Team tools and workflows

A technically valid style may still reduce maintainability if it conflicts with the conventions understood by the rest of the team.


16. Pattern Categories by Scope

Design patterns can also be distinguished by the scope of the problem they address.

Architectural Patterns

Architectural patterns influence the structure of an entire application or major subsystem.

Examples include:

  • Layers

  • Broker

  • Client-Server

  • Master-Slave

  • Model-View-Controller

  • Pipes and Filters

Classical Design Patterns

Classical design patterns influence several classes or components but usually do not determine the entire application architecture.

Examples include:

  • Adapter

  • Decorator

  • Strategy

  • State

  • Command

  • Observer

  • Composite

  • Prototype

Idioms

Idioms solve small, language-specific problems, often at the level of a method, block, or language construct.

Examples include:

  • Scoped locking

  • Scoped resource management

  • Language-specific boilerplate conventions

  • Python’s module-entry idiom

The distinction is based primarily on scope and language dependence.


17. Making Design Decisions with Patterns

Knowing pattern names is useful because patterns provide a shared vocabulary among developers. A team can discuss a design concisely by saying that it may need a Broker, Mediator, Monitor, or Command structure.

However, recognizing a pattern is not enough. A developer must also evaluate whether it is appropriate.

A sound design decision involves:

  1. Identifying the recurring problem.

  2. Describing the relevant context.

  3. Listing the forces and constraints.

  4. Considering candidate patterns.

  5. Comparing their benefits and liabilities.

  6. Checking whether the resulting consequences are acceptable.

  7. Applying the simplest suitable design.

  8. Avoiding unnecessary patterns and overengineering.

For example, choosing between Mediator and Observer requires considering:

  • How many components communicate

  • Whether communication should be centralized

  • Whether notification is one-to-many

  • Whether communication is synchronous or asynchronous

  • How much coupling is acceptable

  • How much overhead the system can tolerate

A pattern is appropriate only when its consequences fit the system’s requirements.


18. The Importance of Explicit, Findable, Understandable, and Applicable Knowledge

Patterns help transfer design knowledge by making it:

Explicit

Experience is written down rather than remaining only in the minds of individual developers.

Findable

A named pattern can be searched for and located in books, documentation, educational material, or technical discussions.

Understandable

A structured pattern description explains the context, problem, forces, solution, and consequences in a form that other developers can study.

Applicable

The most important goal is practical application. Developers should not merely memorize pattern names; they should be able to recognize situations in which a pattern is appropriate and apply it to real problems.

The value of a design pattern comes from applying the design knowledge to an appropriate problem, not from using the pattern name mechanically.


19. Central Takeaways

  • A design pattern is a proven solution template for a recurring, nontrivial problem.

  • Patterns describe context, problem, forces, solution, consequences, and known uses.

  • Patterns are generally independent of programming language; language-specific solutions are called idioms.

  • Design patterns provide a shared vocabulary for communicating software design.

  • Creational patterns address object creation.

  • Behavioral patterns address object behavior and collaboration.

  • Architectural patterns shape the structure of entire applications.

  • Wrapping patterns add abstraction, compatibility, control, behavior, or simplicity around existing components.

  • The SOLID principles support maintainable, flexible object-oriented designs.

  • Decomposition, abstraction, decoupling, reuse, and simplicity are broad principles that support good software design.

  • Every pattern has trade-offs; benefits must be balanced against liabilities.

  • Patterns should not be applied automatically. Their use must be justified by the problem and its forces.

  • The ultimate purpose of patterns is to make proven design knowledge explicit, reusable, understandable, and applicable.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent