On 5/26/05, Martin Cooper <[EMAIL PROTECTED]> wrote:
> 
> I'm not sure how you can be burned by not having direct access to a
> member while there are getters and setters available. 

My mistake.  The cases that keep flashing in my head provided getters
(if even that) but no setters.  In those cases, I had problems because
the superclass would use the instance without going through the
getter, so even if I overrode the getter, I couldn't make the change
the behavior of the superclass.

Hubert

> On the other
> hand, making a member directly accessable severely curbs the ability
> to change the class implementation without breaking backwards
> compatibility. Suppose at some point that you decide you don't want to
> keep a reference to the member in the class, but retrieve it on the
> fly. Or perhaps you decide that you want to keep the reference in a
> cache of weak references. You're hosed, because any code that used
> that member is now broken.
> 
> This is something that I really dislike in a lot of the Struts code.
> For much of it, it's no doubt too late to change. However, I'd very
> much prefer that we don't continue to exacerbate the problem.
> 
> --
> Martin Cooper
> 
>

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

Reply via email to