On 8/25/07, Timo Rantalaiho <[EMAIL PROTECTED]> wrote:
> On Sat, 25 Aug 2007, Igor Vaynberg wrote:
> > always try setter/getter first, if not fallback onto the field.
>
> +1
> Direct field access works typically so I like to omit
> accessor bloat when possible, and if you need any special
> handling in the accessor just create the accessor method for
> it.
>
> If you want to conform better with the javabean way, maybe
> you could make falling back to direct field access a
> setting (default to true, please ;)).
>
> I (and surely many others) like field access anyway, and use
> it with Hibernate as well.

It is convenient, sure. Hibernate has a better reason for it than we
have though. There can definitively be cases where you want to hide
members for direct outside access, but want to persist them. What we
are discussing here though is quite a different case. If it is no
problem that people access members directly, and you think getters and
setters are too much bloat, why don't you just make them public then?
I'm not against directly accessing that, and I think this is something
that is supported by most if not all EL out there. But having private
members without getters and setters but saying they should be easily
accessible by the outside world is kind of a double standard.

So, public getters/ setters first, public fields as a fallback.
Private fields as a fallback, well maybe if there is a setting for it
and/ or when they are fields of components. Or if we have a hard time
agreeing to each other, maybe just not. Like Igor and Matej pointed
out, anyone can easily write their own implementations, so we can
stick to something that is predictable though maybe not as convenient.

Eelco

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

Reply via email to