3 ms·
Almost. One of the biggest advantages of a class factory is that it can return a pointer to an interface rather than a concrete class.
by Koshkin 7y ago
Almost. One of the biggest advantages of a class factory is that it can return a pointer to an interface rather than a concrete class.
- inetknght 7y agoYes but that doesn't meaningfully change what a "factory" is: a factory returns an already-constructed object or smart-pointer-to-that-object you can work with. Whether or not that object is concrete or an interface to a hidden implementation is less important IMO.