Hallo,
I'm defining a method inside an interface to take in a user defined base class A. For example
void doSomething (A a)
The client and the server talks thru glacier2 and I have a session class. So really the call goes from the client to the session class, then to the server. My client is calling doSomething with a derived class B (B extends A), but it seems like by the time it gets to the session class, B has been sliced to A. I called ice_id() on the argument in the session class and it gives me the type for A. I believe I have to link the session with B's definition so that it doesn't get sliced? I did that and it still gets sliced.
I'm wondering if I'm missing anything.
I'm thinking of an alternative approach where instead of using
void doSomething(A a), maybe I should do
void doSomething(ByteSeq a). So I'll send the serialized version of the class (using streaming API) and then deserialize it on the server. But I don't want to do that if I don't have to. Having said that maybe that's a better approach anyway? I don't have to worry about linking in all the derived classes, which may not be known ahead of time.
Thanks

Reply With Quote