Skip to content

Glossary: Software Design Patterns in Java

Factory method

A pattern where a parent class has an abstract method that makes a part, and each subclass overrides it to choose which object to make. `SaverShipment` returns a `UspsCarrier`.

Where the book teaches it

Related terms

Simple factoryAbstract factoryAbstract class