Back to list
Views:   10K
Replies:  1
Archived

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?

Thanks
Mike Michaelis, Dec 10, 2010
Reply 1
Mike:

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>();
africa.RunFoodChain();

We will make the necessary correction to the pdf.

Dan

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


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas