UNDER CONSTRUCTION
- Design Patterns - Elements of Reusable Object-Oriented Software
- Overview
- What, Why, and Who?
- What's inside
- Requirements and Build
Design patterns are typical solutions to commonly occurring problems in software design. They are like pre-made blueprints that you can customize to solve a recurring design problem in your code.
All patterns can be categorized by their intent, or purpose, for further reading please refer to this section.
Because design patterns are a toolkit of tried and tested solutions to common problems in software design. They're like learning color blends instead of just trying out every pair of colors to get a desired color (solution).
A history lesson here,
Short answer; Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm, back in 1994.
Better answer:
Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994 by the so-called "Gang of Four" (Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides), which is frequently abbreviated as "GoF".
Learn more on design patterns at Refactoring.Guru and Wikipedia.
This is my implementation of the Design Patterns from the book
'Design Patterns: Elements of Reusable Object-Oriented Software'
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
ISBN 0-201-63361-2
Copyright 1995
21th Printing, November 2000
The nice thing about the Design Patterns book is that it is... well... not complete :-) To come to a complete working implementation of all the Design Patterns presented in the book and be able to play with them, requires some extra coding. The goal of this project is to actually provide the missing pieces and come to something that will compile and run cleanly.
On the following websites, I have found C++ code that helped me complete everything:
- http://www.c-jump.com/CIS75/Week11/
- http://www.c-jump.com/Download/Patterns/Prototype/html/
- https://code.google.com/p/basic-algorithm-operations/source/browse/trunk/DP
- http://dislab.hufs.ac.kr/wiki/Lecture/Design_Pattern
- http://blog.csdn.net/joey_zoy/article/details/5610810
- https://github.com/wangqiang8511/C---Design-Patterns-Examples/
And here are some interesting slides that give some more explanation:
A more modern C++11 approach using Boost libraries was given in a talk by Tobias Darm given here:
An interview from 2009 with the GoF authors is given here:
A dependency analysis and refactoring of the Gang of Four examples can be found at
Implemented Design Patterns so far:
Behavioral Patterns
- Chain of responsibility
- Command
- Iterator (aka Cursor)
- Observer
- Strategy
- Template Method
Creational Patterns
- Abstract Factory
- Builder
- Factory Method
- Prototype
Foundation Classes
Structural Patterns
- Adapter
Requirements:
- Cmake
- C++ compiler
Each category has its own cmake file, hence you will need to change directory to the desired category cd, run the following commands one by one:
cd {Category_dir}/
cmake -S . -B build
cmake --build ./build
...You can also use CMake's -j N option for parallel builds on N cores and -v for verbose builds:
cmake --build build -j 4 -vNote
Replace {Category_dir} with the actual directory name.
