This session is part of the Software Design Track.
C++ programs that are dynamic in nature have to create objects at some time during run-time. New objects can be created by explicitly calling ‘new’ and then the data type of that object. However, this requires that a programmer knows at ‘compile-time’ what object should be created. What we would like, is to have a layer of abstraction, or someway to create objects at run-time to reflect the dynamic nature of some C++ programs. Luckily, there is a common pattern that can help solve this problem--the factory design pattern.
In this talk, we are going to discuss a creational design pattern known as a factory. The pattern can be as simple as a function, or take on other forms as a distributed factory, or an abstract factory. We’ll show some basic examples of a factory in modern C++ as well as real world use cases of where factories occur for further study. Finally, we’ll discuss the tradeoffs of the factory pattern, and discuss which scenarios you may not actually want to use a factory. Attendees will leave this talk with the knowledge to go forward and implement the factory pattern, as well as how to spot the factory pattern in projects they may already be working on!
ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY:
https://cppcon.digital-medium.co.uk/