3.1.4 Serialization

In an remote procedure call system, a key decision is how to represent the data structures within the messages passed between clients and servers. In this exercise, we will think about some of the necessary mechanisms.
  1. A remote procedure call system has a simple interface representation, where the following is an example.
    const MAXLENGTH 256;
    
    struct id {
       string name<MAXLENGTH>;
       int    pin;
    };
    
    program BANKACCOUNT {
       version BANKVERS {
         void deposit(id,float) = 1;
         void withdraw(id,float) = 2;
         float balance(id) = 3;
       } = 1;
    } = 0x28786554;
    

    Design a representation system for laying out the bits within the request and the response packets. You should consider which information will be known by both ends, and whether there needs to be explicit representation of type information or of data length information.

  2. Java uses object references as well as primitive types. Discuss the problems in serializing Java objects, with particular reference to encoding chains of objects, and to deciding whether references are remote or local.
Ian Wakeman 2005-02-22