I've got a base class, and two child classes that extended it. When I wrote them, I would always know what type of child class I'd want. Now I've got a case where it depends on a lookup. I could do a switch/case where I include the appropriate child class and instantiate it, but I'm thinking a factory should hold that logic.
The question is, should I go back to the places where I've already instantiated the child classes and switch them to use the factory? They'll keep working as they are, and will save an extra db lookup that otherwise the factory will have to do.
Are there any good reasons not to instantiate child classes directly if they're also available via a factory?