what do you think of gustav and eelco's IModelLocator / get/setModel idea?
Frank Silbermann wrote: > > > I don't care much for getValue() because to me the word "value" suggests > "atomic value" (or even "atomic constant") -- which is not the general > case. > > At first I thought of recommending getBusinessObject() to distinguish > the result from the framework-oriented model classes, but that could be > confusing if it were common practices to embed wicket models inside of > wicket models (the Decorator pattern). If that's they case, I would > deprecate getModelObject() and replace it with getUnwrappedModel(). > > (Obviously, wicket documentation must somewhere explain the necessity of > _wrapping_ business objects in Wicket model classes to be accessed by > wicket components. Once that process is understood, multiple levels of > wrapping should not be too difficult to understand.) > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan > Locke > Sent: Tuesday, January 23, 2007 11:35 AM > To: wicket-user@lists.sourceforge.net > Subject: Re: [Wicket-user] VOTE: IModel and 'model object' name change > > > > 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=DEVDE > V >> _______________________________________________ >> 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=DEVDE > V > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > ------------------------------------------------------------------------- > 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#a8526796 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