Hi Matej
Thanks for your reply. In deed, I declared the LoadableDetachableModel
inside the IDataProvider. So the bottom line of your post is, that it is
serialized anyway altogether?
Are there some docs for wicket serialization around? As I figured out,
wicket likes serialization. But so far I wasn't able to find some docs
explaining what is serialized and when. If you - or somebody else - would
give me the right pointers, I'd start a new page in the wiki, that
especially talks about what is serialized and when, what should be
transient, how to troubleshoot/debug/optimize serialization, and so forth.
I am very interested in the inner workings of wicket and this might be a
good starting point to getting into it, so at least for me its worth the
effort ;)
Matej Knopp-2 wrote:
>
> Where do you have your LoadableDetachableModel declared? And what kind
> of IDataProvider are you talking about? If it is wicket's
> IDataProvider than it has to be serializable, because DataView/Table
> keep it's reference.
>
> LoadableDetachableModel is usually declared as anonymous class inside
> component/page, which is serialized anyway, so the implicit reference
> makes no difference.
>
> -Matej
>
> On 10/25/07, Stefan Fußenegger <[EMAIL PROTECTED]> wrote:
>>
>> Hi folks,
>>
>> I am quite new to wicket but I already figured out that it deserved its
>> name
>> ;) Currently, I am playing around with IDataProvider in conjunction with
>> LoadableDetachableModels. As far as I understand, the main purpose of
>> LoadableDetachableModels is to tune serialization performance. At the
>> beginning I looked at the API doc, which suggested using anonymous inner
>> classes for detachable models:
>>
>>
>> public IModel model(Object object) {
>> return new LoadableDetachableModel() {
>> protected Object load() {
>> /* snip - (re)load the object */
>> }
>> };
>> }
>>
>>
>> However, this might not be suited for serialization, as inner classes
>> have
>> an implicit reference on their enclosing object - which was the
>> IDataProvider implementation in my case. As a consequence the
>> IDataProvider
>> object (and all its possible fileds!) would be serialized together with
>> every serialized LoadableDetachableModel - which would lead to an
>> unwanted
>> serialization overhead.
>>
>> Am I missing something here? Like some Wicket serialization voodoo that
>> takes care of it? If not, it would be worth mentioning in the API doc and
>> probably in the wiki as well (I would take care of the wiki if I get
>> green
>> lights).
>>
>> Regards, Stefan
>> --
>> View this message in context:
>> http://www.nabble.com/LoadableDetachableModel-and-anonymous-inner-classes---unwanted-serialization-overhead--tf4689309.html#a13402266
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/LoadableDetachableModel-and-anonymous-inner-classes---unwanted-serialization-overhead--tf4689309.html#a13403458
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]