Appendix A. Design Patterns For Dummies®

Design Patterns For Dummies®
Design Patterns For Dummies®

The 23 Gang of Four Design Patterns

Here are the original 23 Gang of Four design patterns (from Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley Professional Computing Series, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides).

The Strategy design pattern

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

The Decorator design pattern

Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

The Factory Method design pattern

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

The Observer design pattern

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

The Chain of Responsibility design pattern

Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

The Singleton design ...

Get Design Patterns For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.