Bean Scripting Framework: A Scripting Architecture for the Java Platform

        The Java platform currently lacks a standard scripting architecture. The Bean Scripting Framework (BSF) is an architecture for incorporating scripting into, and enabling scripting against, Java applications and applets. Using BSF, an application can use scripting, and become scriptable, using any BSF-supported language. When BSF supports additional languages, the application will automatically support the additional languages. Scripts in any BSF-supported language can be run directly on the command line, allowing Java components to become first class objects of scripting languages.

        There are many advantages of having a standard scripting architecture. First, adopting a scripting architecture instead of an ad hoc approach to script integration and enabling allows applications to quickly and easily support many scripting languages. Script enabling products allows extensions to be written by a wider audience, not just by programmers in a different language, but by people who consider themselves non-programmers. Second, having a single scripting architecture for the platform enables scripting language developers to conform to the architecture once and be universally available to all applications. Finally, common services such as debugging services, which support all scripting languages can be developed. BSF fulfills a similar role for the Java platform as the Microsoft Active Scripting Framework does for the Win32 Platform.

        The BSF architecture consists primarily of two components: a BSFManager which provides scripting services for applications and the BSFEngine interface, which is the abstraction by which BSF interacts with scripting engines.

        The list of scripting languages currently supported by BSF are Netscape Rhino (JavaScript), Jacl, JPython, NetRexx, Bean Markup Language and LotusXSL. Both Java-implemented languages (e.g., Rhino and Jacl) as well as non-Java ones such as Perl and LotusScript are under development. On Win32 platforms, active scripting languages including VBScript and JScript will be supported. A debugging architecture to support inline debugging of scripts is also under investigation. BSF is currently under development by IBM Research and IBM Software Group, however, we envision making BSF freely available and possibly even developed under an open-source model.

By: Sanjiva Weerawarana, Matthew J. Duftler, Sam Ruby, Rick Rineholt

Published in: RC21583 in 1999

This Research Report is not available electronically. Please request a copy from the contact listed below. IBM employees should contact ITIRC for a copy.

Questions about this service can be mailed to reports@us.ibm.com .