Prototypes as Factories

Suppose that you are using the ABSTRACT FACTORY pattern at Oozinoz to provide user interfaces for several contexts. Figure 18.1 shows the user interface factories you have in place.

Figure 18.1. Three abstract factories, or kits, produce different user interface look-and-feels.

The users at Oozinoz are thrilled with the productivity that results from applying the right user interface in the right context. The problem you face is that they want several more user interface kits, and it's becoming burdensome to create a new class for each context your users envision.

To halt the proliferation of user interface factory classes, ...

Get Design Patterns Java™ Workbook 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.