> i disagree completely. the most common usecase for this is for components to
> access their own private fields via property model.
>
>  class namepanel extends formcomponentpanel {
>   private string first;
>   private string last;
>
>   namepanel(..) {
>     add(new textfield("first", new propertymodel(this, "first"));
>     ...
>    }
>
>   updatemodel() { getmodel().setobject(first+"  "+last); }
> }
>
> in the above - first and last are private implementation details of the
> panel.  i do not want them exposed via public getters/setters. so in order
> to avoid it i need to write an inner class that implements imodel for every
> field i want to access - no thanks!

Well, just take a look at the project we are working on together. Such
fields mostly have getters and setters :)

Nevertheless, I agree with this case.

> > Theoretically, this could result in people accessing those members
> > directly where they shouldn't. Even if you think that's fine, I doubt
> > whether this is something Wicket should support.
>
> theoretically i can access private fields without wicket as well.
> theoretically i can rewrite the bytecode and turn every private field into
> public. this is a problem of practicality.

I didn't want to mention the but... because I thought my reply was
verbose enough. Of course people can implement anything they want
themselves.

> it is a religious issue, but an undisputable fact is that this feature saves
> a lot of time and verbousity.
>
> now if you want to get clever you can build in a check to see if the model
> is glued to a component whose private fields it is trying to access and try
> and restrict it, but honestly i see no reason to go this far and add
> overhead

Agreed. I didn't bring up the issue, I'm trying to honestly react to
it. Kent has a point when you look at property models working on
regular Java beans, but if you take inner classes/ members etc into
account, we have more than enough reason to want to support this.

Eelco

-------------------------------------------------------------------------
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