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

Reply via email to