Database Development with Sapphire/Web

Despite its drawbacks, Sapphire/Web certainly speeds application development.

The real potential of the Internet lies in the use of database technology to create cost-effective corporate intranets and useful, dynamic, and truly interactive World Wide Web sites. Database systems provide the juice that powers intranet and Web systems that allow companies to distribute or sell products, services, and information.

One new cross-platform tool is Bluestone's Sapphire/ Web, a powerful visual application builder designed specifically for creating applications for the World Wide Web and internal Web sites. We examined Sapphire /Web as a potential tool for automating the creation of Web pages that interact with databases.

What We Learned

In evaluating version 1. 1 of Sapphire/Web, we found that it does indeed help experienced developers to quickly create distributed applications that use HTML documents as the front-end user interface, and to access Sybase, Oracle, Informix, and other legacy database systems.

Sapphire /Web uses Common Gateway Interface (CGI) programs to link HTML documents into a single project or application, and to enable database access. It includes an, integrated visual-development environment as well as an extensive set of tools and APIs, and it automatically generates C/C++ based CGI executables.

Because a visual HTML editor is not provided and the resulting code is generated in C/C++, development with Sapphire/Web requires a good working knowledge of HTML, SQL, C, and/or C++ This an industrial-strength tool for serious CGI developers.

Getting the Software

Knowledge of scripting languages other than HTML is not required. Developers who have experience using db-UIM/X will find Sapphire/Web extremely easy to use, since the product is based on the same technology as db-UIM/X from Bluestone.

We evaluated Sapphire/Web using a Sun SPARCstation 20 running Solaris 2.4, with 30 MB of available disk space. Our applications were created using the X Window System and Sybase System 10. We used the Netscape 2.0 browser and a configured HTTP server supporting HTT? 1.0 and CGI 1. 1.

We downloaded an evaluation copy of the product from Bluestone's Web site at http://www.bluestone.com The software we looked at consisted of two archives-the Sapphire/Web installation archive (with precompiled executables for the selected platform) and documentation in HTML format.

The installation procedure is straightforward, simple, and well documented. Comprehensive product documentation is available in both PostScript and HTML formats, and the tutorials are well designed and documented, providing a good overview of the product's structure and features.

After we installed Sapphire/Web, we followed the tutorials and created a small application to demonstrate the key functions of the product.

Using Sapphire/Web

Sapphire/Web completely automates generation of CGI code. It then converts HTML templates into HTML documents linked together with the generated CGI code, deploys end-user programs and Web pages, and facilitates testing with a local browser. Figure I diagrams the flow of data between user and server.

Sapphire/Web creates CGI executables through Visual Object g, whereby CGI program process arguments submitted from the HTML documents and pass them to database-accessing objects. These objects produce output used to generate HTML documents from predesigned templates. Database-a objects are presented as HTML fragments contained in HTML files. They may include GUI objects and/or server-like objects such as SQL, stored procedures, functions, executables, and files. These server objects can be located anywhere on your network or enterprise.

To begin the process, drag and drop from your HTML documents and components onto the Object Bind Editor. This "binds" HTML elements such as text-input fields or option menus to arguments; results returned from your object are bound to other HTML elements such as ordered lists or tables. Sapphire/Web automatically populates your HTML templates with the returned data.

Sapphire/Web's visual development environment helps manage Web application development projects; see Figure 2. In addition, it automatically generates C /C++ application code. Several hooks are provided so that legacy code can be added directly into code generated by the product. Links to external source code, object code, and libraries are also possible.

The product provides native SQL implementations for Sybase, Oracle, and Informix, plus an API of function calls, including: HTML-output functions, data-population functions, database ad-hoc query capabilities, table components, login functionality and maintenance states, generic containers, , error-handling functions, CGI-input functionality, data-site callbacks, and function-object implementation.

Sapphire/Web also allows users to integrate their own C/C++ code and libraries. This lets you reuse your code and build applications around legacy code.

Sapphire/Web produces a single executable, which acts as a CGI script that processes all events generated by an application. Thus, the product's CGIs are more reliable than many other scripting techniques that use more shells and scripts fired off per each user click. (However, @ adds a serious amount of overhead to the system.) Since the CGI executables are C/C++ based, users can employ a standard debugger to debug generated applications.

A Test Application

The application we built during our evaluation of Sapphire/Web consisted of a database containing information about publishers, authors, and books. The application allows users to enter search criteria to locate an author, book, or publisher by name; retrieve a list of authors, books, or publishers; retrieve a list of authors and publishers of selected books; and retrieve a list of books by selected authors and publishers.

We first created a Sybase database and loaded it with data using scripts provided by the product tutorial. We then created queries using predefined developer scripts, which were also provided by the tutorial. For the next step, we prepared HTML templates defining the front end of the application and containing data placeholders for the information to be retrieved from the database. The data-retrieving objects were bound to the data placeholders in the HIML templates and, finally, the application code was generated, entirely from within Sapphire/Web.

Drawbacks

Sapphire/Web 1.1 does have its drawbacks; see Table 1. First, it lacks a visual HTML editor with WYSIWYG and drag-and-drop capabilities. You need a third-party HTML editor to create the-HTML templates and documents (Web pages) that serve as the applications front end.

Bluestone is planning to bundle a third party HTML editor with future releases of Sapphire/Web. Even with a third-party WYSIWYG HTML editor, however, you'll still need to know HTML, because you need to manually enter data placeholding tags and references to other HTML templates and documents into the HTML templates. (These data placeholding tags are used by the product's binder to link HTML documents into one project.) To enter the tags, you need to know both HTML and Sapphire/Web's rules regarding how you should define them.

Another problem is that the single CGI executable generated by the product is substantially large. In effect, one large executable is responsible for all actions, and has to be fired every time an action is called. For example, the smallest executable generated by the first product tutorial was about 250K. This creates a lot of overhead on the system each time the Web server starts that executable to process an event Sapphire/Web designers recommend breaking your applications into a number of smaller parts to reduce the size of each executable. However, we discovered that this approach negatively affects the applications consistency.

Finally, Sapphire/Web does not enable cross-reference checking of activator callbacks and the objects to which they refer. This is a potential source of errors if someone moves the objects from the server on which they reside. This might be a problem in a big enterprise, where many servers provide data to the site.

Wrap Up

Despite its drawbacks, Sapphire/Web certainly speeds application development. As with any development tool, however, you only save time if you know how to use it efficiently. You will probably realize many of the product's benefits only when using it to develop larger projects.

If Bluestone adds a visual HTML editor and automating procedures for inserting data placeholding tags, it will turn Sapphire/Web from a very satisfactory into a very powerful Web application-development tool.

Version 2.0 of Sapphire/Web for Microsoft Windows NT was made available in May. Version 2.0 for UNIX is expected by the end of October. According to Bluestone, version 2.0 will include tools that will allow developers to display the object tree of a project, and also to automatically conduct cross-reference checks.

AU in all, as one of the first web application development tools in the market, Sapphire/Web provides more than one could expect in a first-generation product of this kind.

by Julian Shifrin and Donna Oliva
Donna is a principal of UNIF/X Inc., a software development and consulting firm based in New York City that specializes in the development of corporate intranet and customized Web database systems. Juliian is a senior technical specialist with the firm.


   HOME   COMPANY INFO    SERVICES FIND US!

PARTNERS    |    UNIF/X IN THE PRESS    |    WEB/DB LINKS