Maxim Yegorushkin
11/18/2008 1:36:00 PM
On Nov 18, 1:29 pm, Pallav singh <singh.pal...@gmail.com> wrote:
> Hi ,
>
> when should i select Factory Method / Prototype Design Pattern
> during my design phase ??
> as both look similar to me
Factory Method creates a new object. Normally, it invokes a (non-copy)
constructor of a concrete implementation class.
Prototype create a new object as a copy of the prototype object. It is
often implemented as clone() member function that invokes the copy
constructor of a concrete implementation class.
You use Factory Method when you want new objects, prototype when you
want copies of existing objects.
--
Max