Skip to content

Glossary: Software Design Patterns in C++

Simple factory

Also written: factory, factory pattern

One function that knows every class and returns the right object for a name. `create_carrier("ups")` looks up a maker lambda in the `CARRIERS` map.

Where the book teaches it

Related terms

Factory methodAbstract factoryRegistry