This repository contains the source code for the book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (aka, the Gang of Four).
The book is a catalog of 23 object-oriented design patterns. The patterns are organized into three categories: creational, structural, and behavioral. For each pattern, the authors describe the pattern's intent, motivation, applicability, structure, participants, collaborations, consequences, implementation, sample code, known uses, and related patterns.
The book is a classic and a must-read for any developer, regardless of language or platform. The patterns described in the book are still relevant today, and implementing them in Python is a great way to become a better programmer.
The source code for each pattern is contained in a separate directory. Each pattern directory contains a README.md
file that describes the pattern and provides a UML diagram, a list of participants, and sample code. The sample code is contained in one or more Python files.
The sample code is intended to be illustrative, not necessarily production-ready. The code is not intended to be executed as a standalone program, but rather to be used as a reference while reading the book.
If you find a bug or would like to suggest an improvement, please submit a pull request.
This repository is licensed under the MIT License. See the LICENSE file for details.
- Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides
- Design Patterns on Wikipedia
- Python Documentation on python.org