Object-InsideOut - Re: How To Deal With Arrays Passed Into Objects During Initialization

Posted on Thu Dec 1 17:53:16 2005 by jdhedden in response to 1427 (See the whole thread of 6)
Re: How To Deal With Arrays Passed Into Objects During Initialization
This is the "standard" way of storing refs inside objects - you just save the reference, and don't make a copy of the complex structure it contains (especially since this might not always be possible as in the case of objects). It's not necessarily a violation of data encapsulation per se, however, in your case you are levying the additional requirement that a copy of this particular data be stored inside the object. This is fine, but you need to handle that aspect yourself, as I illustrated in my previous reply.
Write a response