Parameterized Factories

Back to Factory Method

Factory methods that accept a parameter (type identifier, string, enum) to determine which concrete product to create. Simplifies the pattern by avoiding separate creator subclasses, though it violates OCP when new products are added.

property factory parameterized