second paragraph:
Because Command instances are sent across the wire, you need to implement Serializable (this marker should be in the concrete class, not the superclasses or interfaces).
Serializable can be in the superclasses or interfaces.
for example:
in the superclasses:
Code:
public class SerializableParent implements Serializable
{
public SerializableParent()
{
super();
System.out.println("Serializable Parent...");
}
}
// Only extends SuperClass
public class SerializableChild extends SerializableParent
{
public SerializableChild()
{
super();
System.out.println("Serializable Child...");
}
}
// Junit Test Case
public class SerializabletTest extends TestCase
{
public void testIt()
{
SerializableParent sp = new SerializableParent();
SerializableChild sc = new SerializableChild();
assertEquals(true,sp instanceof Serializable);
assertEquals(true,sc instanceof Serializable);
}
}
in the interfaces:
Code:
public interface SerializableInterface extends Serializable
{
}
// Only implements SerializableInterface
public class SerializableInterfaceConcrete implements SerializableInterface
{
public SerializableInterfaceConcrete()
{
super();
System.out.println("SerializableInterfaceConcrete...");
}
}
// Junit Test Case
public class SerializabletTest extends TestCase
{
public void testiConcrete()
{
SerializableInterfaceConcrete sic = new SerializableInterfaceConcrete();
assertEquals(true,sic instanceof Serializable);
}
}