Hi! I have said that you might need to "cache" your model values, in some performance situations. If you do not use models, you do not need same kind of caching (because the value is fixed). Nevetheless, using models results in cleaner code, but I am dreaming of a centralized caching mechanism such that each model value would be evaluated only one time per render / model change.
t. Martin 2009/10/23 Joseph Pachod <[email protected]>: > Hi > > Recently, on the mailing list, I read quite some people saying basically > than using models all over the place was a bad idea. Can someone explain it > a bit more ? > > Indeed, I was kind of agreeing until recently, when I had an issue with a > (self made) Behavior taking a string. > > I needed this string to be refresh on each page display... So what to do > then ? Introduce a model to be able to use LoadableDetachableModel if needed > (and maybe still providing a convenience method from string to > model<String>). > > So, since, I'm kind of thinking that as soon that you do a reusable > component, you should use models if data is needed. The only "proper" use > case I could think of for not using a model is through a convenience method > or for a local only component. And even that is doubtful, I've already > rewritten some locally used component then to a Model (instead of the > initial string)... > > As such, in the end, using a model looks like a warranty against future > changes. > > Do I miss some use cases ? > > thanks in advance > joseph > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
