yeah. i agree. if we did anything it would be better to change IModel as i said, but then just deprecate getModelObject() and add a preferred version as getModelValue() as johan suggested. this would only break code that directly uses IModel (a more limited number of users).
Eelco Hillenius wrote: > > I voted -1, but here is my opinion about the change proper. > >> public interface IModel<V> extends IDetachable >> { >> V getValue(); >> void setValue(V value); >> } > > This would be for the better imo, though I don't hate the original > getObject *that* much. It's just what you are used to and I think > documentation on how models should be used is a lot more important. > > >> we would also change getModelObject() to getValue() as well as any other >> related methods like getModelObjectAsString() to getValueAsString() (or >> valueAsString() if preferred). there might be naming conflicts somewhere >> or >> other problems, but i don't know of any offhand. > > Tbh, I actually don't think Component#getValue is for the better. I > think Component#getModelObject is way clearer than Component#getValue. > In the end I think both value and object are ambiguous, and this > should be fixed by documentation and examples. > > Btw, If there is *anything* I never liked about the whole model > business, it is the fact that Component has methods to get the model > value in the first place (getModelObject etc). > > The indirection that IModel provides is something to get used to. It > is one of the places where we traded clarity and simplicity for > flexibility. I think it'll be hard to grasp for newbies no matter the > naming, so the better our documentation and examples are, the quicker > they will be able to wrap their head around it. > > Eelco > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/revising-the-%22Working-with-Wicket-models%22-page-tf3016921.html#a8526349 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user