On 7/7/07, Kent Tong <[EMAIL PROTECTED]> wrote:
> If we accept that 1) is a good reason for allowing private field access,
> then according to the same reasoning, we should always make our fields
> public and thus eliminate the need for getters and setters. As we are
> not going that, so I believe 1) is not a sufficient reason.

I think this is a strawman argument. You make a mosquito an elephant
in one step.
Monkeys like bananas, I like bananas, therefore I am a monkey.

Like it or not, propertymodels already break encapsulation, the law of
demeter and refactoring without having to resort to private accessors.
So if you go all OO, these things should never be used, especially
since there is a perfect OO alternative:

There is nobody preventing you to stop using PropertyModel and
implementing Model.getObject and Model.setObject yourself, providing
refactor safe, accessor only ways to bind your model to your
components. It is just a lot of work. Hell, you could even install a
security manager that prohibits PropertyModel completely.

If you don't like to do that (given the code explosion I can imagine
it), there is a second best alternative: name your fields different
from the bean accessors. Nobody is preventing you to do that either.

According to the best of my knowledge this was implemented because of
speed. Instead of having to search through methods hooking into the
fields saves quite some time.

Martijn

-- 
Wicket joins the Apache Software Foundation as Apache Wicket
Apache Wicket 1.3.0-beta2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to