What is a factory pattern?

What is a factory pattern?

Approach: Describe object creation without specifying exact class.

A creational design pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created.

Follow-up: What is the Abstract Factory pattern?

Key concepts: abstraction, instantiation.