I was just reading a thread on SO that was discussing the merits of Singleton vs. Static Classes.
Some people mentioned that pattern X appeared to be more of a 'factory' rather than a Singleton 'pattern'.
What are the differences between a 'factory' and a 'design pattern'?
A "factory" is a specific design pattern: http://en.wikipedia.org/wiki/Factory_method_pattern
Similarly "singleton" is also a design pattern: http://en.wikipedia.org/wiki/Singleton_pattern
Factories and Singletons are some of the many design pattern.
A factory pattern can be implemented as a singleton pattern that produces objects. A factory could also be an instanced class, and therefore not a singleton. Likewise, a singleton can be a factory, but it can also be something else, like a global settings manager or event registry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With