Quick Start Exercise

As exercise we will write a small application for your postoffice. Our company has done a requirement analyzes going to know that customers must be able to send and receive letters. A letter consists of three attributes 'sender', 'recipient' and 'content'. A recipient can connect to postoffice to accompish three tasks:

First step of application programming is to design API that fullfills all requirements. We will use CORBA's interface definition language (IDL) to sketch the servers API the client shall interact with later. This IDL file is going to be used later for code generation, which covers complete low level IO for distributed method invocation, so user can focus on higher level functionality of application.

Table 1. postoffice.idl

module PostOffice {
      exception UnknownRecipient { string message; };
      exception UnknownSender    { string message; };
      exception MalformedContent { string message; };
     
      struct Letter {
        string      sender;
        string      recipient;
        string      content;
      };

      interface Counter {
        boolean   has_letter_for   (in string recipient);

        Letter fetch_letter_for (in string recipient)
           raises (UnknownRecipient);

        void   send_letter     (in Letter letter)
           raises (MalformedContent, UnknownSender, UnknownRecipient);
      };

}; 

Keywords of IDL differ slightly from those known from Java or C++, please see for further details at OMG for IDL specification.