Skip to content
Advertisement

Tag: factory

Correct Use Of Factory Pattern?

I have been doing research on the factory design pattern and was wondering if the below example, while not “textbook” is technically a correct use of it. Is there another design pattern that may fit the situation better? Answer IMO: Looks like the given code example actually implemented the Factory Method pattern with using the Method Object solution https://refactoring.guru/replace-method-with-method-object. Because

Advertisement