Skip to content

Why a factory

Code creates an object whose concrete class depends on a configuration value.

Why put that decision in a factory rather than in the calling code?