Part VIIFactories

Part Overview

Factory patterns help with the creation of objects. But that may not be their most important use. Seen from the new perspective, they are much more.

Chapter

Discusses These Topics

20

Lessons from Design Patterns Factories

I describe how following the principles and practices of patterns implies we have to separate the use of objects from the construction/management of objects, hence factories.

21

Singleton and Double-Checked Locking Pattern

I describe a couple of simple factories that ensure only one object of a type exists.

22

The Object Pool Pattern

I relate a past project I was on in which I derived the Object-Pool pattern from the practices I learned from patterns. This ...

Get Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition 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.