1 Reply Latest reply: Jul 4, 2011 12:49 PM by jschellSomeoneStoleMyAlias RSS

    When should we use prototype pattern?

    fxbird
      I know object cloning is a concrete usage, but when we should use that?
        • 1. Re: When should we use prototype pattern?
          jschellSomeoneStoleMyAlias
          Since this is a java forum the following from GoF is relevant...

          ------
          "Prototype is particularly useful with static languages like C++...and little or no type information is available at run-time...It's less important in languages...that provide what amounts to a a prototype (i.e, a class object) for creating instances of each class."
          ------

          Java of course has java.lang.Class and has plenty of type information.

          Cloning is a very special case that is outside normal java.