Chapter    10

Abstract Factory Pattern

In this chapter, I describe the abstract factory pattern. This pattern is similar to the factory method pattern that I described in Chapter 9 but allows a calling component to obtain a family or group of related objects without needing to know which classes were used to create them. Table 10-1 puts the abstract factory pattern in context.

Table 10-1. Putting the Abstract Factory Pattern into Context

Question

Answer

What is it?

The abstract factory pattern allows a calling component to create a group of related objects. The pattern hides the details of which classes are used to create the objects and the reason why they were selected from the calling component. This pattern is similar to the factory method ...

Get Pro Design Patterns in Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.