Skip to content

Glossary: Software Design Patterns in Rust

Factory

Also written: factories, factory function

A function that makes values, such as create_carrier turning a name into the right carrier, so callers never need an if chain.

Where the book teaches it

Related terms

Simple factoryFactory methodAbstract factory