So, something like this?

        private String myString;

        public String getMyString()
        {
                String returnedString = this.myString;
                return (returnedString);
        }

I'm not sure how this applies to my cloning issue....

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


-----Original Message-----
From: Erik Price [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 12:39 PM
To: Struts Users Mailing List
Subject: Re: Cloning Form Beans




Jerry Jalenak wrote:
> Not sure what you mean by 'defensive copies'....  Is there something
special
> I need to do in my bean so I end up with a 'true' duplicate, and not just
a
> second reference?

Defensive copies... described in Josh Bloch's "Effective Java".  Getter 
methods return a copy of the property that they would return in a normal 
class, so that client code can't affect that property and have the 
change trickle back into your object.  Required for immutable classes 
that compose other objects which are mutable.





Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at the following email 
address: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to