The Artima Developer Community

Legacy Design Forum
Canonical Object Idiom

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

java

Posted by piyushpaurana on August 06, 2001 at 4:50 AM

> I believe that all classes should support a copy constructor:

> public void someMethod (Foo fIsaFoo) {
> Foo barIsAnotherFoo = new Foo(fIsaFoo);
> ....
> }

> At the very least, a constructor with the signature:

> public Foo (Foo fooToCopy);

> should clone the argument supplied.






Replies:

Sponsored Links




Google
  Web Artima.com   
Copyright © 1996-2007 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us