On 6/23/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

> Does holding references to other Pages inside a Page make them be
serialized
> twice ? Like :
>
> class MyPage extends Page {
>
>     List<Page> otherPages;
>     ....
> }

Yep, if you are using the SecondLevelCacheSessionStore, which is the
default for Wicket 1.3, evry page will get serialized as a whole, and
everytime you do that, it needs to resolve all the references
completely.

Note that this does not mean you will be using more RAM - that's the
same (except for the object pointer).


So actually it wont do any harm, just an object reference is added, right ?

would it make any difference if it was inside another object, like :
>
>
> class MyPage extends Page {
>
>      MyPageHolder pageHolder; // serializable
>      ....
>  }
>

Nope. Any object that is non-transient and referencable will be
serialized, so this won't help.

There are optimizations possible, but it will probably be a hit on
your programming convenience. For instance, I think it is possible to
just store the page map/ page id and page version combination and use
that if you want to redirect to a previous one. Might be an idea to
check out if you are worried about optimizing.


Actually I just want to make sure it wont take much more ram either way. I
am trying to implement a simple BreadCrumb bar, by keeping each page's
breadcrumb history (the recent page references) in itself. Is this a safe
way for a page to hold references to other pages ?

Thanks a lot !
Iman
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to