3
Creational Design Patterns
When developing applications, you frequently design and manage objects. You create them dynamically or assign them to variables for later use. If left unchecked, this can lead to brittle code due to numerous alternative ways of object creation or improper management of their lifetime, resulting in memory leaks.
The first and most fundamental category of patterns we’ll explore in this book is creational design patterns.
You’ll start by learning how the Singleton pattern ensures that only one instance of an object is maintained throughout a program’s lifetime. Then, we’ll cover the Prototype pattern, which will teach you how to copy existing objects without recreating them from scratch.
Using the Builder pattern, you’ll ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access