users@jax-rpc.java.net

serialize and deserialize interfaces/abstract classes

From: John L. Fjellstad <john_at_PRODEXNET.COM>
Date: Mon, 21 Oct 2002 21:35:40 -0700

Is it legal to serialize and deserialize interfaces?

ie.
My class look like this:
public interface Foo
{
     public int getIntType();
     public String getStringType();
}

public class IntFoo implements Foo
{
     public int getIntType() { return 1; }
     public String getStringType() { return null; }
}

now endpoint would be something like:
public Bar
{
      private Foo f;
      public void setFoo( Foo f )
      {
            this.f = f;
       }
}

etc...

Basically, Foo is an interface/abstract class. It looks like on the
server side, the deserialization doesn't realize it has to use the
subclasses... Any ideas?

Thanks.
--
John L. Fjellstad,  Software Engineer
ProdEx Technologies
14471 Big Basin Way, Suite E
Saratoga, CA 95070
USA
Phone: (408) 872-3100