Skip to main content

Posts

Showing posts from October, 2013

The GoF Hot Spots - Factory Method vs Abstract Factory

As part of my "GoF Design Patterns - The Hot Spots" posts series, this post is focused on two Creational Design Patterns: Factory Method and Abstract Factory. We will dig into the original GoF Design Patterns (aka: DP) description trying to figure out the real Hot Spots (aka: specific particular parts that differentiating them from each other) of these two DPs and the relationship between them. In order to maximize the clarity of this article, I used two conventions: Phrases inside [square brackets] are meant to help understanding GoF definitions Italic sentences are GoF's book citations Factory Method GoF Definition: " [1] Define an interface for creating an object, [2] but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses." GoF Description & Hot Pots: "Consider a framework for applications that can present [handle] multiple documents to the user. Two key abstractions i