ActionScript 3.0 Saturated Abstract Factory 6: The Abstractory

Bringing together Abstract Factories and Families of Products
In the last installment of the saturated Abstract Factory, you saw that unlike the Factory Method where a concrete factory instantiates a single concrete product, the Abstract Factory instantiates a family of products. In this final post in the Abstract Factory saturation series, you will see how the factories (creational classes) create more than a single product. Each of the concrete creational classes instantiate two or more concrete products that have different product interfaces but are “joined in instantiation” by the individual concrete factories that share a common interface. In effect, the family planning is done by the Abstract Factory interface, and not the Product interface. Click the factory button to play the final product of this series and the download button to get all of the files we’ll be looking at:


Before continuing take another look at the full class diagram of the Abstract Factory design pattern in Figure 1:

Figure 1: Abstract Factory Class Diagram
First, consider the way that the Abstract Factory interface contains methods for instantiating more than a single product. Each concrete factory instantiates a minimum of two products. It is like the Factory Method, but each concrete factory only instantiates a single product in the Factory Method. The Abstract Factory creates Multiple products.

Figure 2: Think of Ganesha when considering the role of the busy Client
Read more…




Bill Sanders
Recent Comments