Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: Doubts on design patterns

Ben Hill

2004-05-07

Replies:

On Fri, 2004-05-07 at 11:17, Ram Kishore wrote:
> Hi all,
>      I've a doubt on Prototype design pattern. What SHOULD I use
> while creating the new object?I mean,shd I use clone of the object (can
> be either Deep or Shallow) or directly creation of the object using
> 'new' operator?
>
> I guess,we have to use clone of the objects bcoz GoF says "create new
> objects by copying this prototype".

Check out www.javacoder.net/patterns.jsp for some Java code for that pattern.

HTH

Ben

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.