Interfaces

All Request Encoding as Objects applications share a common network protocol and distributed object system: LDO and Request Encoding as Objects. However, each class will define methods which may be invoked remotely over Request Encoding as Objects. Some programming languages are dynamic enough that the method signature (its name, result type and argument types) is not required at compile time. Perl is one of these programming languages. However, many others, including Java, C++ and Objective-C require that the signature be visible in order to verify the correctness of the method call.

CORBA corrects the visible signature problem by requiring all class interfaces to be written in IDL: the Interface Description Langauge. Request Encoding as Objects requires that instead of writing an interface and compiling it external to the class implementation, the class implementation itself will be used to create the class interface. In languages which support class inspection, such as Java and Objective-C, the interface will be generated on the fly at runtime based on information the compiler has provided in the executable code. Other langauges, such as C, will require the author to maintain the interface seperately from the implementation.

When an ObjectID is sent to a Request Encoding as Objects process, the object interface must also be sent along with it. If the receiving Request Encoding as Objects process does not have a proxy class for the interface, it must construct one for use in the process. This may require generating bytecode on the fly, or producing source code and passing it through an external compiler to be dynamically loaded. However, since Request Encoding as Objects was mainly intended to be used by scripting languages, the automatic generation of proxy classes from an interface obtained at runtime is rarely going to be an issue.

There does however still exist the problem of defining the interface for a langauge such as Java which needs all method signatures at compile time in order to typecheck the arguments and result type of the method. All Request Encoding as Objects implementations which require signature information at compile time must implement a program which can automatically generate the interface prior to compilation. The program must contact a valid Request Encoding as Objects server which has the implementation of the interface, request the interface, and then produce the necessary compiler information. (For Java this means writing out a .java or a .class file describing the interface.)