Re: When NOT to use models ?

2009-11-14 Thread Martin Makundi
it's more like an model graph.. so you say IModelListSomething dataFromDB=new LoadableDetachedModel() ... IModelInteger countModel=new CascadingLoad..ModelInteger,ListSomething(dataFromDB); add(new Label(counter,countModel)); countModel.detach() is called from Label, and

Re: When NOT to use models ?

2009-10-27 Thread Michael Mosmann
Am Montag, den 26.10.2009, 10:24 +0200 schrieb Martin Makundi: Hmm, maybe I'm missing something, but if you want to have EVALUATED once per request, I think the following should be sufficient. (unless I'm missing somtething) I want a generic centrally managed solution. I don't want to

Re: When NOT to use models ?

2009-10-26 Thread Pieter Degraeuwe
Hmm, maybe I'm missing something, but if you want to have EVALUATED once per request, I think the following should be sufficient. (unless I'm missing somtething) new AbstractReadOnlyModelT() { private transient T cachedValue; @Override public T

Re: When NOT to use models ?

2009-10-26 Thread Martijn Dashorst
Which is identical to the LoadableDetachableModel. Nothing in LDM states that it is meant exclusively for DB access. Martijn On Mon, Oct 26, 2009 at 8:52 AM, Pieter Degraeuwe pieter.degrae...@systemworks.be wrote: Hmm, maybe I'm missing something, but if you want to have EVALUATED once per

Re: When NOT to use models ?

2009-10-26 Thread Martin Makundi
Hmm, maybe I'm missing something, but if you want to have EVALUATED once per request, I think the following should be sufficient. (unless I'm missing somtething) I want a generic centrally managed solution. I don't want to cache every model manually. ** Martin        new

Re: When NOT to use models ?

2009-10-26 Thread Joseph Pachod
Martin Makundi wrote: Hmm, maybe I'm missing something, but if you want to have EVALUATED once per request, I think the following should be sufficient. (unless I'm missing somtething) I want a generic centrally managed solution. I don't want to cache every model manually. From what I

Re: When NOT to use models ?

2009-10-25 Thread Martin Makundi
What I found was that I was instantiating my LDM's as private variables in my custom components but that they were not being detached.  In this case you need to programatically register your non default models to participate in the detachment process.  See the Wiki here for an example:

Re: When NOT to use models ?

2009-10-24 Thread Michael O'Cleirigh
Hi Martin, I saw the same type of behavior you are talking about with LoadableDetachableModels not detaching but AbstractReadOnlyModel's working properly. What I found was that I was instantiating my LDM's as private variables in my custom components but that they were not being detached.

When NOT to use models ?

2009-10-23 Thread Joseph Pachod
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

Re: When NOT to use models ?

2009-10-23 Thread Martin Makundi
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

Re: When NOT to use models ?

2009-10-23 Thread Michael Mosmann
Am Freitag, den 23.10.2009, 15:06 +0300 schrieb Martin Makundi: 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

Re: When NOT to use models ?

2009-10-23 Thread Martin Makundi
evaluated only one time per render can be done with LoadableDetachedModel .. I do not mean LOADED once per render. I mean EVALUATED once per render. In my understanding LoadableDetachableModel does not guarantee reset in any particular stage. can you explain it a littly bit (a link to your