The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

[Java] Anonymous classes and serialisation

The following code which is in an instance of Class 'Foo' creates an instance of Button. This Button instance will be stored in an HttpSession.

Button testVal = new Button(root,"testVal","Validate Now");
testVal.addActionListener( new IComponentActionListener()
        {
          public void actionPerformed(RequestContext context, EventObject event)
          {
            /do stuff....
          }
        } );

IComponentActionListener extends Serializable, and Button implements it too. When the session is replicated (in a clustered environment) will the instance of 'Foo' be serialised as part of the anonymous IComponentActionListener impl too? (And what about if that impl references a final variable local to the method in Foo that creates it?)
AH Send private email
Wednesday, September 06, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz