Archived

This forum has been archived. Please start a new discussion on GitHub.

using (de-)serialize-methods of ice

Hi,
the ice-runtime must use an algorithm for serializing and unserializing of prameters and ice-classes.
How to use this algorithms in my program? I need this because I need to write some ice-class-objects to a database without knowing the structure of an object.

for example:
data.ice

module MyModule{
    class A { int alpha; };
};

server.ice
#include "data.ice"
module MyModule {
    interface MyInterface {
        void doStuff(A a);
    };
};

client.ice
#include "data.ice"
module MyModule
{
    class B extends A  { int beta; };
};

The server only knows of class A and teh client extends that class to class B and calls the doStuff-method mit an object of class B. I know that no extended information is lost by calling the implementation of the method doStuff. The doStuff-method should insert the passed object to a database.

Comments

  • marc
    marc Florida
    The easiest way to do this is to use Blobjects, provided that you do not want to interpret the parameters of the operation call at all, but simply handle them as a sequence of bytes.

    If you need more control, you can use Dynamic Ice and InputStream, and interpret some of the parameters using InputStream's operations, and others, with some knowledge of the Ice protocol and how it encodes classes, as a sequence of bytes.