On Mon, Oct 10, 2011 at 03:26:01AM +0100, sebb wrote:
> On 9 October 2011 18:16, Gilles Sadowski <[email protected]> wrote:
> 
> >> This is slightly different from the original suggestion; IIRC that did
> >> not include using getters.
> >
> > I put getters because you asked them. But, indeed, there is no difference
> > with direct accessing the arrays since the getters do not return a copy: it
> > is possible to modify the "original" array.
> 
> Those are *not* the getters I was referring to.
> 
> I intended the getter to return an array element, not the array, so as
> to protect the array contents.

Don't you think that it will make the access much slower?

> As you point out, there's absolutely no point having the getter otherwise.
> 
> The current implementation is not particularly secure against
> malicious or accidental tampering.

The only tampering could come from a bug in classes in the same package. OR
do I miss something?

> That is why I left the arrays in the same source file originally, as
> it allows the arrays to be automatically protected, without needing a
> getter.

Yes I understand the argument. Mine is that this data should not be stored
there.


Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to