Hello, I’ve uploaded the first iteration of “Head First Design Patterns in C++” – the white-gold version. It contains the example found in the ‘Welcome to Design Patterns’ chapter; the ‘SimUDuck’ application. As previously mentioned, I am approaching this version differently; one chapter at a time; however, unlike the ‘Bronze’ version, and the ill-fated ‘Silver’ version, this version deviates to some extent from the book. ... read more
Hey! I've created a blog (http://hfdpcpp.wordpress.com/about/) for this project. Take a look, and hopefully, participate. Thanks in advance, Glenn
It seems like every other year or so that I have a reason to revisit this project. It has always been my plan to do continue C++ work in conjunction with developing .Net C# for a living. Until now, those two goals have proven to be mutually exclusive, until now. With my discovery of GPU’s, programming in parallel, CUDA and NVIDIA. Suddenly, what was old is new again; maybe even a C++ renaissance! (http://channel9.msdn.com/posts/C-and-Beyond-2011-Herb-Sutter-Why-C) ... read more
I have discovered GPUs and general purpose parallel programming!
That is, the use of GPUs in conjunction with CPUs. As such, I have a renewed interested in C & C++ -- I’ve been in the land-of-nouns (C#) for the past few years.
Anyway, I’m going to dabble, tinker or otherwise play with C++ again; however, in addition to completing the long-forgotten Gold version, which I intend to complete, I’m considering creating a Platinum version that incorporates parallel-programming patterns… ;-)
Recently I returned to the scene of my crime and discovered that this project is still relatively active (in downloads anyway). So, I was wondering if anybody out there is actually using it and if it’s worth pursuing the so-called 'gold' version.
The SVN repository has been populated the latest Bronze and Silver versions. Although the Silver version is not complete, work on the Gold version has begun, current thinking is to publish to SVN as I go rather than wait until I have a complete version. Anyway, hope you find it useful.
I have released Silver.1.6.zip which contains a new example pattern: 'Mediator' as
discussed on page 622 in 'Head First Design Patterns'.
As always, my intent is to implement the example as described in the book; however,
I did have a couple of embellishments: I added a (minimal) WeatherStation and
automation of the example.
The WeatherStation tells auto-house if it is raining and automation of the example
is driving by two (optional) parameters: 'interval' and 'iterations' specifying
the length of a virtual day and the number of days to simulate respectively. The
default is a simulated (yet accelerated) 24 hour day where 1 hour equals one second
and runs for a simulated week where 1 iteration = 1 day.... read more
The basis for this example was taken from the 'Menus" project in the 'Composite'
folder. I did not implement every menu item, doing so would not have added to
the illustration of the pattern.
The 'Health Rating' formula is contrived, although the values for Cholesterol,
Carbohydrates, Calories, Fat, Protein, Sodium, and recommended Daily values came
from nutritional web-sites. Yes, I actually spend and evening looking them all
up. :-) 'Health Rating is shown following a vertical bar (|) and is the total
of all ingredients in a menu item.... read more
Interestingly, the ‘Interpreter’ pattern does not explain how to create an
abstract syntax tree [GoF, p247] yet, that is where I spent most of my time
writing and looking for an elegant solution. I think I could have done more
but I was already tardy in delivering this example. That and changing jobs
impacted my intentions to deliver timely examples.
Another non-pattern related idom is the istream_iterator iterators that give
processing either console or file streams its elegance; however, the 'Visitor'
pattern afforded the greatest elegance to this example. I originally intended
to create an example that implemented only the 'Interpreter' pattern, then
apply the 'Visitor' pattern later to illustrate their differences. This proved
futile and I opted to apply the 'Visitor' pattern immediately.... read more
Added 'Flyweight' pattern example: "Fowlweight".
I deviated from the example in the book for two reasons: I wanted to 'sort'
ducks as illustrated in the 'Template Method' pattern and since that illustration
sorted by 'weight' I thought naming the example 'Fowlweight' combined both the
pattern and its intent. Since I deviated, I felt obligated to write a narrative
in the same tone as that used throughout the book. Here is my humble attempt: ... read more
Added 'Chain of Responsibility' pattern example to the the 'Silver' version (See readme.txt for more information and additional changes)
Silver.zip now contains 'Bridge' and 'Builder' examples.
Silver (C++ centric) version has been released. Still a (Beta) work in progress but I wanted to get it out sooner rather than later. Also, work to provide missing (Leftover) patterns can start, which I hope to have soon.
A literal translation from Java to C++ is now available -- the Bronze version. See readme.txt in file package for more details.