vendredi 20 septembre 2019

Task.Factory and factory pattern

Factory pattern is mostly used/recommended to be used while creating an object belonging to a sub class (there should be multiple sub-classes too). One such definition from dofactory - Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses (https://www.dofactory.com/net/factory-method-design-pattern).

Given this definition, is it apt for Task.Factory to be example of factory pattern, as there are no sub classes for Task classs' parents.

Aucun commentaire:

Enregistrer un commentaire