Head First Design Patterns (2020 2nd Edition)
I have recently updated all the codes for Head First Design Patterns for the 2nd edition of the book, released in May, 2021.
Download the code and compile and run from the command line, or load the code into project in Xcode using C++11 or higher.
Here are the command instructions for compiling and running this project from the command line:
compiling all the CPP files and then generating the executable main file
g++ test.cpp -std=c++14 -Wall -o main
running the main file
./main
A designer thinks about how to create flexible
designs that are maintainable and that can cope with change
. One of the secrets
to creating maintainable OO systems is thinking about how they might change in the future and these principles address those issues.
Encapsulate
whatvaries
- Favor
Composition
over Inheritence Program to Interfaces
rather than Implementations
Design patterns don’t go directly into your code, they first go into your BRAIN. Once you’ve loaded your brain
with a good working knowledge
of patterns, you can then start to apply them to your new designs, and rework your old code when you find it’s degrading into an inflexible
mess of code.