CorbaScript


CorbaScript is an object-oriented scripting language designed to support interaction with Common Object Request Broker Architecture objects. It was developed to provide a flexible scripting environment for both client- and server-side CORBA application development, leveraging dynamic invocation and interface reflection capabilities.
CorbaScript is a dynamic, interpreted language whose syntax resembles that of C++ and Java. However, it integrates several design elements from dynamic languages such as Python and Smalltalk. Like those languages, CorbaScript treats all values as objects and supports dynamic type checking at runtime. Source code is translated into pseudocode executed by a dedicated Virtual Object-Oriented Machine that includes a simple reference-counting garbage collector.

Features

Basic scripting

CorbaScript includes typical scripting features:
The runtime includes a simple garbage collector based on reference counting.

CORBA integration

CorbaScript is tightly integrated with CORBA middleware and provides full access to both the Dynamic Invocation Interface and Dynamic Skeleton Interface :

Advanced integration

CorbaScript also includes additional capabilities beyond basic scripting:

Modules

CorbaScript allows any script to function as an importable module. Some standard modules include:

Demonstrations

A number of example applications and tools are included in the CorbaScript distribution:
  • hello: a basic CORBA client/server "Hello World" application.
  • calc: a simple calculator service.
  • chat: a chat system implementing factory and observer design patterns.
  • component: client callback components using implicit connections.
  • computer: a distributed prime number service.
  • event: event channel implementation using the OMG Event Service.
  • grid: factory pattern for grid objects.
  • ir: navigation through the CORBA Interface Repository.
  • linked: demonstration of recursive object invocation.
  • naming: integration with the CORBA Naming Service.
  • test: argument type and passing mode demonstrations.
  • worker: client-server example using deferred (asynchronous) invocations.
  • remote_cssh: scripting engine interface using OMG IDL and shell-based remote invocation.
  • process: CORBA object access and factory pattern using URLs.

Examples

Hello Example

The following illustrates how CorbaScript can be used to interact with a CORBA object defined by the following OMG IDL interface:

interface Hello ;

Using CorbaScript, you can invoke operations on a CORBA object implementing this interface:

>>> # the `hello` variable refers to a CORBA `Hello` object.
>>> hello = Hello
>>> # invoking the 'hello' operation
>>> hello.hello
>>> # invoking the 'display' operation
>>> hello.display
>>> # obtain the CORBA Naming Service
>>> NS = CORBA.ORB.resolve_initial_references
>>> # resolve a name in the CORBA Naming Service
>>> object = NS.resolve
>>> # easier syntax with automatic sequence conversion
>>> object = NS.resolve
>>> # invoke operations on the resolved object
>>> object.display

CorbaScript allows for easy and intuitive invocation of CORBA objects.

Implementing CORBA objects in CorbaScript

The following example demonstrates implementing the `Hello` interface in CorbaScript:

# define a script class implementing the Hello interface
class HelloImpl



>>> # create an instance
>>> hello = HelloImpl
>>> # local invocation
>>> hello.hello
The OMG IDL `hello` operation is invoked.
>>> hello.display
Hello World!
>>> # connect to CORBA and specify implemented interface
>>> CORBA.ORB.connect
>>> # register the object in the CORBA Naming Service
>>> NS = CORBA.ORB.resolve_initial_references
>>> NS.bind

This example demonstrates how CorbaScript simplifies both the invocation and implementation of CORBA objects. Additional examples, such as a CORBA Naming Service shell and a CORBA CosNaming implementation, are provided in the CorbaScript distribution.

Availability

The CorbaScript interpreter is implemented in C++ and is available on most major Unix-based systems as well as on Windows.