Question regarding factory pattern
- by eriks
I have a factory class to build objects of base class B.
The object (D) that uses this factory received a list of strings representing the actual types.
What is the correct implementation:
the factory receives an Enum (and uses switch inside the Create function) and D is responsible to convert the string to Enum.
the factory receives a string and checks for a match to a set of valid strings (using ifs')
other implementation i didn't think of.