Design Patterns by Gamma et al describes Prototype pattern:
Is Clone()
considered as a factory method? (For comparison, an abstract factory is a collection of factory methods.)
Why are they (not) factory methods? For clarification, could you also provide the definition of a factory method?
An example of Clone()
is
Door* Door::Clone () const {
return new Door(*this);
}
There is a similar question In builder pattern, is method `buildpart()` factory methods?
Aucun commentaire:
Enregistrer un commentaire