![]() |
![]() ![]() |
|
Accessing Other Languages Continued from Database Access If you have existing functions written in another programming language and you want to incorporate their functionality into a JavaScript application, JavaScript's external library framework will come in handy. Using this framework, JavaScript applications can call functions written in C--and through C, other programming languages, such as C++ or Visual C++. Because you don't have to convert the functions to JavaScript, you reduce development time and often gain the advantage of improved performance. Functions written in a programming language other than JavaScript are called native functions and must be placed in an external library that can be accessed or shared dynamically in the runtime environment. For Windows systems, the external library must be a dynamic link library (DLL). For Unix systems, the external library must be a shared object. Once you place a native function in an external library, you must register the library with the JavaScript runtime environment. Registering the library tells the runtime engine that applications are cleared to access the library. If you want to go beyond the external library framework, you'll need to use LiveConnect. In the server-side environment, LiveConnect is essentially a set of extensions for Java. These extensions make it possible for JavaScript to access Java, and through Java any objects that are CORBA-compliant. CORBA (short for Common Object Request Broker Architecture) specifies an architecture for communication between distributed objects. With CORBA, the operating system and the object's programming language don't matter as long as the object complies with the architecture. Java objects interact with other objects via an intermediary called an ORB (object request broker), which lets objects make and receive requests from other objects. When a request comes in, the ORB intercepts it and maps the request to the object that is supposed to handle it. Afterward the ORB invokes the appropriate method in the receiving object and passes available parameters as necessary. Finally, it returns the results to the object that made the request. Fortunately, once you create the necessary objects and extend them for CORBA, all this interaction takes place behind the scenes. Server-side JavaScript lets you leverage your knowledge of this powerful scripting language to create dynamic Web applications that can run in any browser and on any platform. It's especially useful for building the database-driven applications so necessary to corporate success on the Web today. More World-Wide Web Published as PC Tech Feature in the 5/4/99 issue of PC Magazine. Related Links |
|
TOP | ![]() Copyright (c) 1999 Ziff-Davis Inc. |