[Cs3] Prototype vs Abstract Factory Patterns
Mikhail Nesterenko
mikhail at cs.kent.edu
Tue May 3 23:01:10 EDT 2022
>
> I???ve been comparing both the abstract factory and prototype patterns. Functionality wise how are they different?
>
Okay, I am guessing it is midnight and exam preparation is in full
swing.
As per the textbook (Page 126), "an abstract factory might store a set
of prototypes from which to clone and return product objects".
So in my understanding, Prototype is more transparent than Factory:
the client asks the prototype to give a clone (copy) of itself. The
pattern use is when making a copy from scratch is undesirable.
The object creation is hidden inside a Factory. In case of an Abstract
Factory, even factory itself is abstracted and hidden from the client.
The use is when object creation needs to be hidden.
Thanks,
--
Mikhail
More information about the cs3
mailing list