since the serialization's root is the outer class (page) and it
contains references to inner classes, this is not an issue.

this would only be a problem if, for example, you had an anonymous
textfield and wanted to serialize just that - then the page would get
pulled in as well which might be a problem, but this is a fabricated
non-usecase.

-igor

On Sun, Aug 10, 2008 at 11:44 AM, Sergey Podatelev
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> In many of Wicket examples, components are added to pages as anonymous inner
> classes, like this:
>
> public class PageA {
>
>  public PageA() {
>
>  ...
>  add(new SomeComponent() {
>
>    public boolean overridenMethod() {
>      ...
>    }
>
>  });
>
> }
>
> Also, I understand that each Wicket component added to any Page is
> serialized.
> However, Java specification doesn't recommend serialization of inner
> classes:
>
> "...Serialization of inner classes (i.e., nested classes that are not static
> member classes), including local and anonymous classes, is strongly
> discouraged for several reasons. Because inner classes declared in
> non-static contexts contain implicit non-transient references to enclosing
> class instances, serializing such an inner class instance will result in
> serialization of its associated outer class instance as well...."
>
> http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/serial-arch.html#7182
>
> I assume that the very first reason, outer class' serialization, is not an
> issue, but what about other concerns? Are those the paranoid-level issues,
> or there're particular Wicket properties dismissing such concerns as well?
>
> --
> sp
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to