Basic Concepts
OiL is an extensible component-based architecture for object request brokers (ORB). An ORB provides an infrastructure to perform remote method invocations (RMI) on objects residing in separated processes, possibly through a network. The use of an ORB is one of the most common ways to develop distributed object-oriented applications. OiL is provided as a Lua module that can be required by the following command:
require "oil"
OiL provides a very flexible ORB implementation and almost every one of its aspects can be changed by replacement of its components (see the Internal Architecture). Nevertheless, OiL relies on three fundamental concepts that define the programming model supported:
- Broker
- is the medium remote invocations are sent through. To perform remote invocations, it is necessary to create at least one broker. Multiple brokers can be used to define multiple ways to perform or receive invocations.
- Servant
- is an object registered in a broker that can be invoked through a network. The servant is exposed as a distributed object accessible by remote clients.
- Proxy
- is a local object that represents a distributed object. All method invocations on a proxy result in a similar invocation on the servant implementing the distributed object it represents.
Multithreading
An essential feature common in almost every ORB is the support for multithreading. OiL supports a cooperative multithreading model which is implemented over the coroutines provided by Lua. This model of multithreading is fundamentally different from preemptive multithreading, which is supported by most modern platforms. For a complete discussion about the multithreading model supported by standard OiL see section Cooperative Multithreading.