Click Here!

PC Magazine

  PC Tech

Server-Side JavaScript

Introduction

Why Server-Side JavaScript?

The Architecture

Diagram: How LiveConnect Works

Session Management

File and Mail Services

Database Access

Accessing Other Languages



X10.com - The SuperSite for Home Automation!

NextCard Internet Visa - Apply Now

 
  Categories
World Wide Web

Server-Side JavaScript
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
JavaScript-powered Stylesheets -- PC Tech
DHTML That Works in Both IE and Navigator -- PC Tech
JavaScript -- DevHead
ScriptHead Archive -- DevHead
 
JavaScript Programming Courses -- ZDU

 
 SPONSORED LINKS
QUANTUM  Storage solutions to count on 24 hours/day, CLICK HERE
Sprint  FrameRelay: See why users rate Sprint #1 for frame relay
Beyond.com  Click here for free software!
Software  X10.com -- The SuperSite for Home Automation
Books  Buy a gift for MOM, a book from barnesandnoble.com
 ZDNET FEATURED LINKS
Freebies!  The latest FREE files - yours to download and keep!
Shop Smart  Compare prices on over 7,000 computer products & save
Contest  Win a Diamond MP3 Rio from ZDNet Auctions!
 MAGAZINE OFFERS
Free Issue  Get a risk-free issue of RED HERRING magazine today!

TOP
Copyright (c) 1999 Ziff-Davis Inc.