GoF Design Patterns 4.0 pdf question #1
Page 7 states
"Continents are represented as enumerations. The AnimalWorld constructor dynamically creates the desired factory using the Continent enumerated value. "
This is not correct, at least with the code I just downloaded last night. Continents are not dynamically created using an enumerated value. AnimalWorld is a generic which takes the continent type as a parameter.
Is the PDF out of synch with the code?
Mike Michaelis, Dec 10, 2010
You are right. In Design Pattern Framework 4 the AnimalWorld is a generic that takes continent type as parameter, like so:
var africa = new AnimalWorld<Africa>();
We will make the necessary correction to the pdf.
Dan McMillan, Dec 12, 2010
Not at all satisfied by the answer. Need some concrete answer which says this is this possible / benefits of singleton which cannot be done by simple static class
Apr 17, 2012