Creational Design Patterns in Modern C++

Video description

The best way to solve common object-oriented design problems is by implementing design patterns. However, understanding and learning design patterns can be time-consuming and intimidating, but this course has got you covered! With Creational Design Patterns in Modern C++, you’ll learn how to understand and implement creational design patterns in C++ with the help of engaging examples.

The course begins with an introduction to creational patterns, giving you a tour of UML class diagrams and SOLID principles. You’ll become familiar with logger classes, multithreading, and patterns and gain a solid understanding of singletons in C++. As you progress, you’ll get to grips with the factory method and find out how to implement it in the application framework. Once you’ve covered the intent, structure, and implementation of the object pool pattern, you’ll discover how to use the abstract factory pattern. Finally, you’ll delve into prototype implementation with the help of a gaming example and apply the builder pattern.

By the end of this course, you’ll have developed skills needed to create and implement patterns in modern C++.

What You Will Learn

  • Implement singleton in C++ with thread-safety
  • Use the factory method to encapsulate the construction process
  • Avoid repetitive construction with object pool pattern
  • Control the construction process of an object using the builder design pattern
  • Control the construction process of an object using the builder design pattern
  • Construct objects based on a context using abstract factory


Whether you are new to design patterns or an experienced software or C++ developer or a project manager who wants to implement creational design patterns using modern C++, this course is for you. Basic knowledge of C++ and object-oriented programming is necessary to get started with this course.

About The Author

Umar Lone: Umar Lone is a civil engineer who found his calling in software development. He started teaching C++ and Visual C++ 15 years ago. Currently, he trains software professionals in various software companies in India in different technologies, such as modern C++, advanced C++, STL, design patterns, Android, Unity, Linux, and more. He is extremely passionate about teaching and has trained more than 20,000 software professionals.

An avid gamer, Umar is currently trying his hand at game development in Unity and Unreal. He has a few Android applications to his credit, including one on design patterns. The only thing he likes more than C++ is Modern C++.

Table of contents

  1. Chapter 1 : Introduction
    1. Course Introduction
    2. Introduction to Patterns
    3. Overview of the Unified Modeling Language (UML) Class Diagram
    4. S.O.L.I.D. Principles - Part I
    5. S.O.L.I.D. Principles - Part II
    6. S.O.L.I.D. Principles - Part III
    7. Creational Patterns - Overview
  2. Chapter 2 : Singleton
    1. Introduction
    2. Basic Example
    3. Logger Class - Part I
    4. Logger Class - Part II
    5. Lazy Instantiation
    6. Destruction Policies
    7. Multithreading Issues
    8. Why a Double-Checked Locking Pattern (DCLP) Fails?
    9. Meyer's Singleton
    10. Using the std::call_once Function
    11. CRTP Idiom
    12. Clock Class
    13. Monostate Pattern
    14. Singleton Versus Monostate
    15. Singleton Issues
    16. Registry of Singletons - Part I
    17. Registry of Singletons - II
    18. Pros and Cons
  3. Chapter 3 : Factory Method
    1. Introduction
    2. Basic Implementation - Part I
    3. Basic Implementation - Part II
    4. Application Framework - Discussion
    5. Application Framework - Implementation
    6. Application Framework with the Factory Method
    7. Parameterized Factory Method
    8. std::unique_ptr
    9. std::shared_ptr
    10. Pros and Cons
  4. Chapter 4 : Object Pool
    1. Introduction
    2. Basic Example
    3. Pooling Game Objects - Part I
    4. Pooling Game Objects - Part II
    5. Multiple Actors - Part I
    6. Multiple Actors - Part II
    7. Multiple Actors - Part III
    8. Generic Pool - Part I
    9. Generic Pool - Part II
    10. Pros and Cons
  5. Chapter 5 : Abstract Factory
    1. Introduction
    2. Basic Example
    3. Basic Implementation with the Abstract Factory
    4. Database Framework - Introduction
    5. Database Framework - Implementation
    6. SQL Server Database Classes
    7. MySQL Database Classes
    8. Database Framework Usage
    9. Using the Factory Method
    10. Using the Abstract Factory
    11. Pros and Cons
  6. Chapter 6 : Prototype
    1. Introduction
    2. Cloning Types
    3. Basic Example
    4. Game - Introduction
    5. Game Implementation - Part I
    6. Game Implementation - Part II
    7. Game Implementation - Part III
    8. Cloning Example
    9. Game Implementation - Part IV
    10. Game Implementation - Part V
    11. Game Implementation - Part VI
    12. Class Versus Object
    13. Varying State
    14. Prototype Manager - Part I
    15. Prototype Manager - Part II
    16. Memory Management
    17. Pros and Cons
  7. Chapter 7 : Builder
    1. Introduction
    2. Basic Implementation
    3. File Example - Introduction
    4. Issues
    5. Builder Implementation
    6. Construction Using the Builder Pattern
    7. Modern Implementation
    8. Fluent Builder
    9. Pros and Cons

Product information

  • Title: Creational Design Patterns in Modern C++
  • Author(s): Umar Lone
  • Release date: October 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781800568242