myth about factory pattern
- by leiz
This has bothered me for awhile, and I have no clues if this is a myth.
It seems that a factory pattern can ease the pain of adding a dependency for a class.
For example, in a book, it has something like this
Suppose that you have a class named Order. Initially it did not depend on anything. Therefore you didn't bother using a factory to…