# www.gofpattern.com llms.txt # generated: 2026-02-08T21:42:47Z # entries: 150 - [GOFPattern (Behavioral, Creational, Structural)](https://www.gofpattern.com): This website discusses the Gang of Four Patterns in C++ and Java as well as behavioral, creational, and structural design patterns. - [GofPatterns | SiteMap (Behavioral, Creational, Structural)](https://www.gofpattern.com/sitemap.php): This page represents the sitemap for gofpattern.com which discusses behavioral, creational, and structural design patterns. - [GofPatterns Website (Terms of Service)](https://www.gofpattern.com/terms.php): This page contains the terms of service for the website GofPatterns. - [GofPatterns Privacy Policy (Analytics Tracking)](https://www.gofpattern.com/privacy-policy.php): This page contains the privacy policy for the website gofpattern.com. - [GofPattern - (Google Search)](https://www.gofpattern.com/google-search.php): This page contains the Google Custom Search Engine for behavioral, creational, and structural design patterns. - [Design Patterns | GoF Patterns (Glossary)](https://www.gofpattern.com/design-patterns/design-patterns-glossary.php): This glossary contains terms for design patterns and the Gang of Four Design Patterns subject used in software engineering. - [Design Patterns Course (Intro)](https://www.gofpattern.com/design-patterns/module1/intro-design-patterns.php): The first module in this course presents you with the fundamentals of Design Patterns. - [Design Patterns (Course Requirements)](https://www.gofpattern.com/design-patterns/module1/design-pattern-course-requirements.php): This page discusses the hardware and software requirements to take this course, such as editor, compiler and language of choice. - [Design Pattern Course (Expectations)](https://www.gofpattern.com/design-patterns/module1/design-patterns-course-expectation.php): This page discusses the design patterns course expectations within the context of the Gang of Four Patterns. - [Design Patterns (Course Project)](https://www.gofpattern.com/design-patterns/module1/design-patterns-course-project.php): This page discusses the general specifications for the Gang of Four course project when using Design Patterns to solve recurring problems. - [Primary Objects Classes (Course Project) - Exercise](https://www.gofpattern.com/design-patterns/module1/course-project-exercise.php): This exercise has you list the primary objects and classes that go into your course project for the Design Patterns Course. - [Defining Design Patterns (Introduction to GOF Patterns)](https://www.gofpattern.com/design-patterns/module2/intro-defining-design-patterns.php): Learn what design patterns are, why they matter, and how they improve object-oriented programming. Explore the three main categories which are creational, structural, and behavioral—to build reusable, maintainable software designs. - [Designing Reusable Classes: Challenges (Pattern-Based Solutions)](https://www.gofpattern.com/design-patterns/module2/challenges-designing-reusable-classes.php): Why code reuse is hard and how GoF patterns, ADTs, and clear contracts enable reusable designs. Includes Java/C++ examples, an OO workflow, and a practical checklist. - [What is a Design Pattern? (Why It Matters)](https://www.gofpattern.com/design-patterns/module2/design-pattern-concept.php): This page explores common problems in a traffic system by means of design patterns used with the Gang of Four. - [Design Pattern Components: Name, Problem, Solution, Consequences](https://www.gofpattern.com/design-patterns/module2/design-pattern-components.php): Learn the four essential elements of a design pattern—name, problem, solution, and consequences—with clear examples, naming guidance, and practical trade-offs. - [Why Use Design Patterns? Real Benefits Across Analysis, Design, Testing](https://www.gofpattern.com/design-patterns/module2/design-pattern-benefits.php): See how design patterns speed delivery, improve testability, reduce coupling, and make systems easier to change. Includes SDLC impact, Java examples, and an adoption checklist. - [Creational vs Structural vs Behavioral Design Patterns | GoFPattern](https://www.gofpattern.com/design-patterns/module2/three-types-design-patterns.php): Clear guide to the three GoF design pattern groups—Creational, Structural, and Behavioral—with quick selection rules, examples, and a lifecycle diagram. - [Distinguish between Class | Object (Patterns)](https://www.gofpattern.com/design-patterns/module2/design-pattern-scope.php): This page distinguishes between Class and Object Patterns used with the Gang of Four design patterns. - [Course Project: Traffic Signals with Safe Coordination (Java State Machines)](https://www.gofpattern.com/design-patterns/module2/course-project-traffic-signals.php): Build traffic light and pedestrian signal classes in Java using state machines and a coordinator that enforces the safety invariant: Green always pairs with Don’t Walk. Includes timed transitions with ScheduledExecutorService. - [Design Patterns Module Conclusion: Key Concepts, Scope, Next Steps](https://www.gofpattern.com/design-patterns/module2/design-patterns-conclusion.php): This module introduced you to design patterns at a very high level to make software development easier. - [Big O Notation (Computer Science Case Study)](https://www.gofpattern.com/design-patterns/module2/big-O-notation.php): This page describes why Big O notation is a common means of evaluating algorithm performance in terms of a parameter. - [Why use Design Patterns (Benefits) - Quiz](https://www.gofpattern.com/design-patterns/module2/why-use-design-patterns-quiz.php): This quiz poses questions with respect to the general use of Design Patterns and how they are used to solve problems. - [Abstract Traffic Signal (Pattern States) - Exercise](https://www.gofpattern.com/design-patterns/module2/abstract-traffic-signal-exercise.php): This exercise asks you to write the Design Pattern classes for the traffic signals used with the Gang of Four. - [Singleton Design Pattern (Intro)](https://www.gofpattern.com/design-patterns/module3/intro-singleton-design-pattern.php): This module discusses the Singleton design pattern and how it is used to insure one instance of a given class. - [Elements of Design Patterns: Intent, Motivation, Applicability, Structure](https://www.gofpattern.com/design-patterns/module3/design-pattern-elements.php): Learn the key elements of design patterns, intent, motivation, applicability, structure, and more. Discover how patterns capture design experience and solve recurring software problems effectively. - [Singleton Design Pattern (Intent, Motivation)](https://www.gofpattern.com/design-patterns/module3/singleton-intent-motivation.php): Learn why Singleton exists, what “single instance” really means today, and when to avoid it. Covers intent, motivation, tradeoffs, and modern best practices. - [Singleton Pattern Applicability (Guidelines When to use)](https://www.gofpattern.com/design-patterns/module3/singleton-pattern-applicability.php): Learn when Singleton is appropriate, when it becomes a global-state anti-pattern, and modern alternatives like dependency injection. Includes practical decision checklist. - [Singleton Pattern Structure (Components, Variants)](https://www.gofpattern.com/design-patterns/module3/singleton-pattern-structure.php): Study Singleton structure: instance field, restricted constructor, getInstance access method. Covers thread safety, lazy vs eager init, enum variant, holder idiom, legacy pitfalls, quiz link. - [Singleton Participants Collaborations (Client Access)](https://www.gofpattern.com/design-patterns/module3/singleton-participants-collaborations.php): Learn how Singleton is composed and how clients collaborate via getInstance. Covers participant roles, access flow, lazy init, thread safety variants, and modern design guidance. - [Singleton Pattern (Consequences, Effects, Tradeoffs)](https://www.gofpattern.com/design-patterns/module3/consequences-effects-singleton-pattern.php): Explore Singleton consequences: controlled access, resource coordination, global-state risks, hidden dependencies, testability, concurrency, synchronized legacy patterns, and modern alternatives like DI. - [Singleton Implementation (Class in C#, Java, C++)](https://www.gofpattern.com/design-patterns/module3/singleton-class-implementation.php): Learn modern Singleton implementations in C#, Java, and C++, including thread-safe lazy initialization, testing concerns, and when to avoid Singletons in favor of DI or pooling. - [Singleton Pattern Real World Examples | GoFPattern](https://www.gofpattern.com/design-patterns/module3/singleton-real-world-examples.php): Real-world Singleton uses: logging, config, metrics, caching, shared clients. Includes modern Node.js, Java, C++ implementations plus testing and deployment caveats. - [Singleton Related Patterns and Substitutes | GoFPattern](https://www.gofpattern.com/design-patterns/module3/related-substitute-patterns.php): Learn which patterns complement or replace Singleton: DI, Factory, Builder, Prototype, Monostate, Module, Observer, Service Locator—plus modern C++ idioms. - [Singleton Variations at GoFPattern (Object Pool, Multiton)](https://www.gofpattern.com/design-patterns/module3/extension-variation-pattern.php): Learn Singleton extensions that reuse controlled creation: Object Pool and Multiton. Includes modern Java executor approach, pooling example, and uniqueness enforcement tips. - [Singleton Course Project (Build the Simulation Clock)](https://www.gofpattern.com/design-patterns/module3/singleton-class-course-project.php): Write the course project Singleton classes by building a shared simulation clock. Learn lifecycle and safe destruction with the Meyers singleton and modern C++11+ guidance. - [Perfect Singleton Design Pattern (make getInstance() synchronized)](https://www.gofpattern.com/design-patterns/module3/perfect-singleton-designPattern.php): This page describes what it takes to make the Singleton Design Pattern perfect. - [Singleton Design Pattern (Conclusion)](https://www.gofpattern.com/design-patterns/module3/singleton-design-pattern-conclusion.php): This module discussed how the Singleton pattern is a creational pattern that lets you create a single instance of a class. - [Singleton Pattern Quiz Design Patterns](https://www.gofpattern.com/design-patterns/module3/singleton-pattern-quiz.php): This quiz tests your understanding of the Singleton design pattern, including intent, participants, consequences, and applicability. - [Singleton Pattern Quiz Explanation](https://www.gofpattern.com/design-patterns/module3/singleton-pattern-quiz-explanation.html): Quiz explanation for the Singleton Pattern quiz: intent, participants, consequences, and applicability. - [Singleton Consequences Quiz Design Patterns](https://www.gofpattern.com/design-patterns/module3/singleton-consequences-quiz.php): Quiz on Singleton consequences: classification, collaborations, controlled access, and appropriate real-world use cases. - [Singleton Pattern Exercise: Implement Panda Singleton](https://www.gofpattern.com/design-patterns/module3/singleton-pattern-exercise.php): Write a Panda class that applies the Singleton pattern and submit your solution for review. - [Dual Design Pattern (Creational) - Exercise](https://www.gofpattern.com/design-patterns/module3/dual-pattern-exercise.php): This exercise asks you to write a class that uses the Dual pattern,which has exactly two instances. - [Singleton Course Project Exercise: Time Class | GoFPattern](https://www.gofpattern.com/design-patterns/module3/singleton-course-project-exercise.php): Write a Singleton Time (simulation clock) class for the course project. Implement a shared clock with currentTime, endOfTime, and a run() loop. - [Creational Design Patterns | Simplifying Object Creation in Software Design](https://www.gofpattern.com/design-patterns/module4/intro-creational-patterns.php): Learn how creational design patterns such as Singleton, Factory Method, Builder, and Abstract Factory streamline object creation, improve flexibility, and make software easier to maintain and scale. - [Creational Design Patterns with C++: Definition, Benefits, Examples](https://www.gofpattern.com/design-patterns/module4/creational-design-pattern.php): Learn what creational design patterns are, why they improve flexibility and testability over direct constructors, and review key GoF patterns with a C++ Singleton example. - [Creational Design Pattern Usage (Factory Method Example)](https://www.gofpattern.com/design-patterns/module4/creational-pattern-uses.php): Learn how creational design patterns manage object creation and explore a real-world Factory Method example using Java’s URLConnection API. - [Compare Creational Patterns (Abstract Factory, Builder, Prototype)](https://www.gofpattern.com/design-patterns/module4/common-creational-patterns.php): Compare and contrast Abstract Factory, Builder, and Prototype patterns and learn when to use each to control object creation in flexible, maintainable software designs. - [Factory Method Motivation (Write Abstract Vehicle Class)](https://www.gofpattern.com/design-patterns/module4/factory-pattern.php): Learn why object creation breaks abstraction and how Factory Method motivates writing an abstract Vehicle class to create flexible, polymorphic designs. - [Factory Method Structure (Develop Vehicle Subclasses)](https://www.gofpattern.com/design-patterns/module4/factory-method-structure.php): Learn the GoF Factory Method structure and build Vehicle subclasses (concrete products) so object creation can be deferred and client code stays decoupled from concrete types. - [Factory Method Consequences (Build VehicleFactory Class)](https://www.gofpattern.com/design-patterns/module4/factory-method-consequences.php): Learn the pros and cons of Factory Method and implement a VehicleFactory that returns Vehicle while selecting Car, Bus, Bicycle, or Pedestrian at runtime. - [Ashes of Creational Classes (Course Project)](https://www.gofpattern.com/design-patterns/module4/creational-classes-course-project.php): This page describes how to write creational classes for the course project using a concrete implementation of the abstract VehicleFactory class. - [Factory Pattern | Creational Design | GoF Patterns (Conclusion)](https://www.gofpattern.com/design-patterns/module4/factory-module-conclusion.php): Module 4 conclusion: Review Factory Method pattern implementation, explore how creational patterns enable adaptable code, and preview structural patterns in Module 5. - [Factory Method Pattern (Abstract Vehicle class) - Exercise](https://www.gofpattern.com/design-patterns/module4/factory-method-exercise.php): This exercise asks you to write an abstract Vehicle class that has the structure shown in this diagram in place of direct instantiation with constructors. - [Concrete Subclasses (Write Four) - Exercise](https://www.gofpattern.com/design-patterns/module4/concrete-subclasses-exercise.php): This exercise asks you to write four concrete subclasses of the Vehicle class using creational patterns in place of direct instantiation with constructors. - [Common Creational Patterns Abstract - Quiz](https://www.gofpattern.com/design-patterns/module4/common-creational-patterns-quiz.php): This quiz poses questions with respect to common creational patterns used with the Gang of Four Patterns. - [ConcreteVehicleFactory Class UML Diagram - Exercise](https://www.gofpattern.com/design-patterns/module4/course-project-exercise.php): This exercise asks you to implement ConcreteVehicleFactory, a concrete VehicleFactory subclass that creates Vehicle objects without direct constructor calls. - [Vehicle Factory Consequences (C++, Java Class) - Exercise](https://www.gofpattern.com/design-patterns/module4/factory-consequences-exercise.php): This exercise asks you to write an abstract class called VehicleFactory in place of direct instantiation with constructors. - [Intro to Structural Design Patterns | GOF Pattern Module 5](https://www.gofpattern.com/design-patterns/module5/intro-structural-designPatterns.php): Learn how structural design patterns organize classes and objects into flexible systems. Explore Adapter, Facade, Proxy, and other GoF patterns with practical examples. - [What is Structural Pattern? (Definition)](https://www.gofpattern.com/design-patterns/module5/structural-design-pattern.php): This page defines structural patterns as one of the pattern categories in the Gang of Four Patterns. - [How Structural Patterns help Programmers? (Capabilities)](https://www.gofpattern.com/design-patterns/module5/structuralPatterns-help-programmers.php): This page describes what structural patterns can do and accomplish for software engineers. - [Common Structural Patterns (Gang of Four)](https://www.gofpattern.com/design-patterns/module5/common-structural-patterns.php): This page lists the common structural patterns that are used in the Gang of Four such as Adapter, Bridge, Composite, Decorator, Facade and Proxy. - [Motivations of Flyweight Pattern (Increase Performance)](https://www.gofpattern.com/design-patterns/module5/flyweight-pattern-motivation.php): This page describes the motivations of the Flyweight pattern, which is a structural Design Pattern. - [Flyweight Suitability Applicability (When not to use)](https://www.gofpattern.com/design-patterns/module5/flyweightSuitability-applicability.php): This page discusses when and when not to use the Flyweight pattern when choosing a design pattern to solve a recurring problem. - [Flyweight Pattern Structure (Convert Vehicles)](https://www.gofpattern.com/design-patterns/module5/flyweightPattern-structure.php): This page describes how to convert vehicles to the Flyweight design pattern, and when it is asked to create a new Flyweight, the Factory class first checks to see whether a matching Flyweight exists. - [Tradeoffs of Flyweight Pattern (What are they?)](https://www.gofpattern.com/design-patterns/module5/flyweightConsequences.php): This page describes the tradeoffs of the Flyweight pattern such as performance and memory tradeoffs, which are classic issues in program optimization. - [Class Vehicle Intersection (pedestrians, bicycles, cars, buses)](https://www.gofpattern.com/design-patterns/module5/class-vehicles-intersection.php): This page asks you to write a class that contains the vehicles currently backed up at the intersection as a simulation. - [Structural Pattern Conclusion (Design)](https://www.gofpattern.com/design-patterns/module5/structural-patterns-conclusion.php): This module discussed how structural object patterns use composition to build larger structures from individual objects. - [Backed up Vehicles Intersection (Queue) - Exercise](https://www.gofpattern.com/design-patterns/module5/backedup-vehicles-intersection-exercise.php): This exercise asks you to write a class that contains the vehicles currently backed up at the intersection as a design pattern. - [Flyweight Pattern (Convert) - Exercise](https://www.gofpattern.com/design-patterns/module5/flyweight-pattern-exercise.php): This exercise asks you to convert vehicles to Flyweight Design Patterns where Vehicle classes are immutable and velocity is constant. - [Common Structural Patterns (GoF) - Quiz](https://www.gofpattern.com/design-patterns/module5/common-structural-patterns-quiz.php): This quiz poses questions with respect to common structural patterns used in Software Engineering. - [Behavioral Design Patterns (Intro)](https://www.gofpattern.com/design-patterns/module6/intro-behavioral-designPatterns.php): This module explores a variety of behavioral design patterns that describe the ways objects and classes interact. - [Behavioral Design Pattern (Definition)](https://www.gofpattern.com/design-patterns/module6/define-behavioral-patterns.php): This page describes how a behavioral pattern enables objects to interact with one another iduring the software engineering process. - [Behavioral Patterns help Programmers (Problem Solving)](https://www.gofpattern.com/design-patterns/module6/behavioralPatterns-help-programmers.php): This page describes how to test the Vehicle class, a behavioral pattern used to describe how objects and classes interact. - [Common Behavioral Patterns (Description)](https://www.gofpattern.com/design-patterns/module6/common-behavioral-patterns.php): This page describes how common behavioral patterns describe the way objects and classes interact within the context of the Gang of Four. - [Observer Pattern (Motivation)](https://www.gofpattern.com/design-patterns/module6/observer-pattern-motivation.php): This page describes how to define the motivation of the Observer pattern within the context of behavioral design patterns. - [Write TimeObserver Interface (Observer Pattern)](https://www.gofpattern.com/design-patterns/module6/observerStructure-timeObserver-interface.php): This page discusses how to write a TimeObserver interface, which uses two abstract classes or interfaces to implement the Observer Pattern. - [Write Time Class as Observed Object (Pattern)](https://www.gofpattern.com/design-patterns/module6/timeClass-asObserved-object.php): This page describes how to write a Time class as an Observed object and make the associated classes concrete. - [Observer Pattern (Tradeoffs when Implementing)](https://www.gofpattern.com/design-patterns/module6/tradeoffs-implementing-observerPattern.php): This page describes some of the tradeoffs of implementing the Observer pattern when selecting a design pattern to solve a particular problem. - [Require Mediator Pattern (Examine Problems)](https://www.gofpattern.com/design-patterns/module6/problems-require-mediator.php): This page discusses software problems that require the Mediator design pattern to describe how objects and classes interact. - [When to Use Mediator Pattern? (Applicability)](https://www.gofpattern.com/design-patterns/module6/mediator-pattern-applicability.php): This page asks you to decide when to use the Mediator pattern to describe how objects and classes interact. - [Mediator Pattern Structure (manages connections between objects)](https://www.gofpattern.com/design-patterns/module6/mediator-pattern-structure.php): This page describes the structure of the Mediator pattern, which is used to manage all connections between different objects. - [Mediator Pattern Consequences (Benefits, Pitfalls)](https://www.gofpattern.com/design-patterns/module6/benefits-pitfalls-mediatorPattern.php): This page describes the benefits and pitfalls of the Mediator pattern when using design patterns to solve a particular problem. - [Write Mediator Class (Course Project)](https://www.gofpattern.com/design-patterns/module6/mediatorClass-course-project.php): This page asks you to write a Mediator class for the course project involving the traffic flow system. - [Behavioral Design Patterns (Conclusion)](https://www.gofpattern.com/design-patterns/module6/behavioral-designPatterns-conclusion.php): This module discussed behavioral design patterns, which are patterns that describe the ways objects and classes interact. - [Testing Interface (SignalMediator) - Exercise](https://www.gofpattern.com/design-patterns/module6/testing-interface-exercise.php): This exercise asks you to run a test on your Vehicle classes and write the Timer Class and Signal Mediator Class. - [Common Behavioral Patterns (Gof) - Quiz](https://www.gofpattern.com/design-patterns/module6/common-behavioralPatterns-quiz.php): This quiz poses questions with respect to common Behavioral Patterns in Software Engineering. - [Observed Object (Time Class) - Exercise](https://www.gofpattern.com/design-patterns/module6/observed-object-exercise.php): This exercise asks you to write a Time class as an Observed object using behavioral patterns to describe how objects and classes interact. - [Time Observer (Interface, Abstract Class) - Exercise](https://www.gofpattern.com/design-patterns/module6/timeObserver-interface-exercise.php): This exercise asks you to write a TimeObserver interface Design Pattern to describe the way objects and classes interact when using the Observer Pattern. - [Signal Mediator Class (Manage 4 Intersection Lights) - Exercise](https://www.gofpattern.com/design-patterns/module6/signalMediator-class-exercise.php): This exercise asks you to write a SignalMediator class for the intersection that manages the four lights. - [Creating Software using Design Patterns (Intro)](https://www.gofpattern.com/design-patterns/module7/intro-designPattern-softwareDesign.php): This module discusses some general issues that arise in using patterns and how to select a design pattern based on a particular problem. - [Choosing Design Pattern (Select for Situation)](https://www.gofpattern.com/design-patterns/module7/how-to-choose-designPattern.php): This page discusses finding a design pattern that fits your needs to solve a particular problem. - [How To Apply Design Patterns (General Rule)](https://www.gofpattern.com/design-patterns/module7/howTo-apply-designPattern.php): This page explores how to apply design patterns and take steps to use the pattern effectively during the software development process. - [Lessons Learned from Design Patterns (unexpected Ways)](https://www.gofpattern.com/design-patterns/module7/lessons-learned-fromDesignPatterns.php): This page examines how patterns can be used in unexpected ways when selecting a design pattern to solve a particular problem. - [Combining Design Patterns (Into Single Class)](https://www.gofpattern.com/design-patterns/module7/combine-design-patterns.php): This page explores how multiple design patterns can be used in a single class or program when selecting a design pattern to solve a particular problem. - [Limitations of Design Patterns (Consequences)](https://www.gofpattern.com/design-patterns/module7/limitations-of-design-patterns.php): This page discusses the limitations of design patterns when using patterns to find a solution. - [Traffic Flow System Course Project](https://www.gofpattern.com/design-patterns/module7/traffic-flowSystem-course-project.php): This page asks you to finish the traffic flow system and review the Observer pattern. - [Design Patterns Course (Conclusion)](https://www.gofpattern.com/design-patterns/module7/designPatterns-course-conclusion.php): This module discussed what design patterns are, and how they can help you write more flexible, reusable, maintainable code. - [Design Patterns Network Continuation](https://www.gofpattern.com/design-patterns/module7/designPatterns-course-continuation.php): This page discusses other courses and sites where were created by DistributedNetworks. - [How to Use Design Patterns (GoF) - Quiz](https://www.gofpattern.com/design-patterns/module7/using-designPatterns-quiz.php): This quiz poses questions with respect to how to use design patterns when selecting a Design Pattern to solve a particular problem. - [Designing Software with Design Patterns - Quiz](https://www.gofpattern.com/design-patterns/module7/designing-designPatterns-quiz.php): This quiz poses questions with respect to designing software using design patterns to solve a particular problem. - [Observer Class (VehicleQueue) - Exercise](https://www.gofpattern.com/design-patterns/module7/observer-class-exercise.php): This exercise asks you to make the VehicleQueue an Observer of the Time class by selecting this Design Pattern to solve the problem. - [Traffic Flow System (Simulation) - Exercise](https://www.gofpattern.com/design-patterns/module7/trafficFlow-system-exercise.php): For this exercise, the traffic simulation is designed to run with no input from the user. - [Behavioral Design Patterns (13 Patterns Described)](https://www.gofpattern.com/behavioral/index.php): This page contains an outline for the Behavioral Design Patterns which are used with the Gang of Four Patterns. - [Chain Of Responsibility Pattern (handle or redirect message)](https://www.gofpattern.com/behavioral/patterns/chain-of-responsibility.php): This page describes the Chain Of Responsibility Pattern which establishes a chain within a system, so that a message can either be handled or redirected. - [Chain of Responsibility (Java Code)](https://www.gofpattern.com/behavioral/patterns/chainOfResponsibility-java-code.php): This page contains the Java code for the Chain of Responsibility behavioral design pattern. - [Command Pattern (Behavioral) in Java (Roles, Flow, Use Cases )](https://www.gofpattern.com/behavioral/patterns/command-pattern.php): Learn the Command Pattern: encapsulate requests, decouple invokers from receivers, and support undo, queues, and macro commands. Includes roles, sequence flow, trade-offs, and a Java code example. - [Command Pattern (Java Example)](https://www.gofpattern.com/behavioral/patterns/commandPattern-code.php): Learn the Command Pattern in Java with a complete example. See how to decouple switches from devices like lights and fans using commands for flexible, reusable code. - [Interpreter Pattern (evaluate sentences in Language)](https://www.gofpattern.com/behavioral/patterns/interpreter-pattern.php): This page describes the Interpreter Pattern, which specifies how to evaluate sentences in a language. - [Interpreter Pattern (Java Example)](https://www.gofpattern.com/behavioral/patterns/interpreterPattern-java-code.php): This page contains the Java code for the Interpreter Pattern to create the Interpreter context engine. - [Iterator Pattern (Sequentially access items in Collection)](https://www.gofpattern.com/behavioral/patterns/iterator-pattern.php): This page describes the Iterator Pattern which provides a consistent way to sequentially access items in a collection independent of and separate from the underlying collection. - [Iterator Pattern (Traverse through group of objects)](https://www.gofpattern.com/behavioral/patterns/iteratorPattern-java-code.php): This page contains the Java code for the Iterator Pattern to provide a standard way to traverse through a group of objects. - [Mediator Pattern (simplifies communication among objects)](https://www.gofpattern.com/behavioral/patterns/mediator-pattern.php): This page describes the Mediator Pattern which simplifies communication among objects in a system by introducing a single object that manages message distribution. - [Mediator Pattern (Java Code)](https://www.gofpattern.com/behavioral/patterns/mediatorPattern-java-code.php): This page contains the Java code for the Mediator Pattern using a chatroom application for demonstration. - [Memento Pattern (Snapshot of Object State)](https://www.gofpattern.com/behavioral/patterns/memento-pattern.php): This page describes the Memento Pattern, which contains a snapshot of the state of an object, so that the object can return to its original state. - [Observer Pattern (Flexibly broadcast messages to Receivers)](https://www.gofpattern.com/behavioral/patterns/observer-pattern.php): This page describes the Observer Pattern, which provides a way for a component to flexibly broadcast messages to interested receivers. - [Observer Pattern Code (Java)](https://www.gofpattern.com/behavioral/patterns/observerPattern-code.php): This page contains a Java example of the Observer Pattern, which provides a way for a component to flexibly broadcast messages to interested receivers. - [State Pattern (Localize state-specific behavior)](https://www.gofpattern.com/behavioral/patterns/state-pattern.php): This page describes the State Pattern which localizes state-specific behavior and partitions behavior for different states. - [State Pattern Code (Java Example)](https://www.gofpattern.com/behavioral/patterns/state-pattern-code.php): This page contains an example of the State Pattern using Java code which localizes state-specific behavior and partitions behavior for different states. - [Strategy Pattern (Family of Algorithms)](https://www.gofpattern.com/behavioral/patterns/strategy-pattern.php): This page describes the Strategy Pattern, which defines a family of algorithms, encapsulates each one, and makes them interchangeable. - [Strategy Pattern Code (Java)](https://www.gofpattern.com/behavioral/patterns/strategy-pattern-code.php): This page contains the Java code for the Strategy Pattern, which is a behavioral design pattern. - [Template Pattern (subclasses override method parts)](https://www.gofpattern.com/behavioral/patterns/template-pattern.php): This page describes the Template Pattern which provides a method that allows subclasses to override parts of the method without rewriting the method. - [Visitor Pattern (represent operation on object structure)](https://www.gofpattern.com/behavioral/patterns/visitor-pattern.php): This page describes the Visitor Pattern which provides a maintainable way to represent an operation to be performed on the elements of an object structure. - [Visitor Pattern Code (Example)](https://www.gofpattern.com/behavioral/patterns/visitor-pattern-code.php): This page contains code with respect to the Visitor Pattern and explains why one would implement this pattern. - [Externalize Stack Pattern (Recursion vs Iteration)](https://www.gofpattern.com/behavioral/patterns/externalize-stack-pattern.php): This page describes the Externalize the Stack Pattern which uses recursion as an alternative way of implementing iteration. - [Hierarchical Visitor Pattern (Visit every node in Structure)](https://www.gofpattern.com/behavioral/patterns/hierarchical-visitor-pattern.php): This page describes the Hierarchical Visitor Pattern which provides a way to visit every node in a hierarchical data structure such as a tree. - [Creational Design Patterns (Object Creation Mechanisms)](https://www.gofpattern.com/creational/index.php): This page contains a list of common Creational Design Patterns used with the Gang of Four Patterns. - [Abstract Factory Pattern (Why it's used)](https://www.gofpattern.com/creational/patterns/abstract-factory-pattern.php): This page describes the Abstract Factory Pattern, which uses an abstract factory class so that its implementation can be given per requirement. - [Abstract Factory Pattern (Java Code)](https://www.gofpattern.com/creational/patterns/abstractFactory-pattern-code.php): This page describes the Abstract Factory Pattern using Java, which provides an additional level of abstraction over your Factory pattern. - [Builder Pattern (Separate Construction of complex object)](https://www.gofpattern.com/creational/patterns/builder-pattern.php): This page describes the Builder Pattern which separates the construction of a complex object from its representation. - [Java Builder Pattern Code (Steps involved)](https://www.gofpattern.com/creational/patterns/builderPattern-code.php): This page contains the Java code for the Builder Pattern as well as the steps required to implement this pattern. - [Factory Method Pattern (static methods to implement interface)](https://www.gofpattern.com/creational/patterns/factory-method-pattern.php): This page describes the Factory method pattern which uses a concrete class with static methods to create instances of objects that implement an interface. - [Factory Method Pattern (Java Code)](https://www.gofpattern.com/creational/patterns/factoryMethodPattern-java-code.php): This page describes the Factory method pattern using Java, which introduces loose coupling between classes. - [Prototype Pattern (Create customized Objects)](https://www.gofpattern.com/creational/patterns/prototype-pattern.php): This page describes the Prototype pattern, which is a creational pattern that allows an object to create customized objects. - [Java Prototype Pattern (Clone existing object)](https://www.gofpattern.com/creational/patterns/prototypePattern-java-code.php): This page describes the Prototype pattern, which creates a new object by cloning an existing object. - [Singleton Pattern (Global point of access)](https://www.gofpattern.com/creational/patterns/singleton-pattern.php): This page describes the Singleton Pattern and its provision for a global point of access to a class. - [Java Singleton Pattern (Three Variations)](https://www.gofpattern.com/creational/patterns/singletonPattern-code.php): This page describes 3 variations of the Singleton Pattern using the Java language. - [Structural Patterns (Relationships between Entities)](https://www.gofpattern.com/structural/index.php): This page contains a list of common structural design patterns used with the Gang of Four Patterns. - [Adapter Pattern (Intermediary between two classes)](https://www.gofpattern.com/structural/patterns/adapter-pattern.php): This page describes how the Adapter Pattern acts as an intermediary between two classes, converting the interface of one class so that it can be used with the other. - [Bridge Pattern (related inheritance hierarchies)](https://www.gofpattern.com/structural/patterns/bridge-pattern.php): This page describes the Bridge Pattern, which divides a complex component into 2 separate inheritance hierarchies. - [Composite Pattern (hierarchical tree structures)](https://www.gofpattern.com/structural/patterns/composite-pattern.php): This page describes the composite pattern which enables you to create hierarchical tree structures of varying complexity. - [Decorator Pattern(Remove Object Functionality)](https://www.gofpattern.com/structural/patterns/decorator-pattern.php): This page describes the Decorator Pattern which enables you to add or remove object functionality without changing the external appearance or function of the object. - [Facade Pattern (One interface)](https://www.gofpattern.com/structural/patterns/facade-pattern.php): This page describes the Facade Pattern, which provides a unified interface to a group of interfaces in a subsystem. - [Flyweight Pattern (Description and Concept)](https://www.gofpattern.com/structural/patterns/flyweight-pattern.php): This page describes the Flyweight Pattern which reduces the number of low-level, detailed objects within a system by sharing objects. - [Proxy Pattern (Remote Proxy)](https://www.gofpattern.com/structural/patterns/proxy-pattern.php): This page describes the Proxy Pattern which provides a surrogate or placeholder object to control access to the original object. - [Adapter Pattern Code (Java)](https://www.gofpattern.com/structural/patterns/adapterPattern-code.php): This page contains the Java code for the Adapter Pattern to translate requests from the Adapter to another class known as the adaptee. - [Bridge Pattern (Java Code)](https://www.gofpattern.com/structural/patterns/bridgePattern-code.php): This page describes the Bridge Pattern which is a structural pattern in the Gang of Four Patterns. - [Composite Pattern (Java Code)](https://www.gofpattern.com/structural/patterns/compositePattern-code.php): This page describes the composite pattern which allows you to have a tree structure and ask each node in the tree structure to perform a task. - [Decorator Pattern (form large object structures)](https://www.gofpattern.com/structural/patterns/decoratorPattern-code.php): This page contains an example of the Decorator Pattern in Java, which is used to form large object structures across many disparate objects. - [Facade Pattern Theory (Java Code)](https://www.gofpattern.com/structural/patterns/facadePattern-code.php): This page contains the Java code for the Facade Pattern which deals with a subsystem of classes. - [Proxy Pattern (Java Code)](https://www.gofpattern.com/structural/patterns/proxyPattern-code.php): This page contains the Java code for the Proxy Pattern which can also be defined as a surrogate.