In C#... factory design pattern, why all "factory class" should be inherited from "abstract factory class" ??
Without inheriting also we can achieve same functionality. Cant we?
Factories that inherit from an abstract factory class are doing so to follow the abstract factory pattern. The abstract factory pattern is useful when you want to create a strategy out of whole groups of object types. For this reason it is also called the "kit" pattern.
Often, factories are perfectly viable without an abstraction. If you don't need one now, leave it alone. You can always make an abstract factory later, if it is needed.
Some more reading:
http://en.wikipedia.org/wiki/Abstract_factory_pattern
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