![]()
December 8, 1997
Portable Web Apps
Sapphire/Web spots integrated links with external data
Sapphire/Web lets you create portable Web applications that can scale to n-tiers as needed. Sapphire/Web's best feature is its easy-to-configure integration with external data sources, including databases, ASCII text files, and external applications. But users might not be crazy about having to manually edit HTML templates to insert Sapphire/ Web's special tags.
Sapphire/Web organizes an application into a project, which contains HTML template pages, data objects, and the bindings bet
ween them. Separating HTML from application logic lets you easily change portions of an application without having to rewrite everything. The templates provide the format for the way the information will be displayed when you view the pages in a Web browser.
Sapphire/Web includes a tag editor to help you create and modify your HTML templates, but it's not a WYSIWYG editor, so you have to know HTML to use it. Each template page contains two types of HTML objects: activators and data sites. An activator can be either an anchor-such as a navigator button or an image-or the entire page. Most HTML pages contain static activators to enable jumps to other pages. With Sapphire/Web, you can enable these activators to run applications. A data site is a Sapphire-specific tag-of the form ## Sa_DataSiteName ## -that you manually insert into the template page to provide output fields that are linked to your database. These tags are proprietary, so you have to perform the painful task of manually editing your HTML temp
late to support Sapphire/Web.
To create the binding between the template tag or activator and your data source, you use the Object Bind Editor. This feature lets you, for example, specify that an activator causes a particular query to run against your database. The results from the query are then output using a specific template containing data sites that are bound to the query's results. You can also use the Object Bind Editor to bind the input fields on one form to the parameters for a database query whose results are displayed using another template.
You can also have your activator perform a database transaction, although you'll have to write the transaction code yourself with Sapphire's API calls. From the Object Bind Editor, you can add C++ or Java code that precedes or follows the action you bind to the activator. You can also use this feature to add code to do other actions before and after your bound action.
Helpful Functions
You can also use the Object Bind Editor to bind your template to other types of data objects, including text files, commands, Sapphire/Web-aware functions, and stored procedures. In this way, you can format the results of a directory listing command by defining a binding between the columns in the directory listing output and data sites in a template.
Database activity can be performed through an ODBC or JDBC connection, via the database gateways included with Sapphire/Web, or through a database vendor's own code. Sapphire/Web includes database gateways for Oracle, Sybase, Informix, Microsoft
SQL Server, and IBM DB2.
Sapphire includes several wizards to help you create application pages. The Table Component wizard lets you create a set of data entry HTML pages that are bound to a data source. You can also use the Java Application wizard to create a Java client-server application.
For team developers, Sapphire/ Web does not include direct support for any source-code control system. Instead, you are expected to modify script files that are automatically run by Sapphire/Web when files are read and written to incorporate the source-code control system's check-in and check-out commands. This isn't the best approach, though it does provide you with a lot of flexibility in exchange for some up-front work.
To keep track of your project, the Project Mapper window lets you see how each HTML page is connected to other pages and to the data objects you've created.
Applications within Sapphire can be composed of VBScript, JavaScript, and Java code, and can include ActiveX components and Java
Beans. You can deploy server applications as CGI code or persistent application servers written in C or C++; as Java servlets, applications, or beans; or as Oracle Web Cartridges. Sapphire/ Web supports ISAPI, NSAPI Web server interfaces, and generic Web server extensions, so you should have no trouble running Sapphire/Web applications on any common Web server. You shouldn't have any trouble porting your application from one operating system to another, either.
When you want to maintain some state information between pages, you can use the ubiquitous cookies or hidden fields that you manually transfer between pages. Alternately, you can use Sapphire's state server. You can access this server using the Sapphire API; it means you get to write more code, but it's easier than cookies.
If you have a heavy request load, you can configure Sapphire's server manager to start additional copies of your application on other Web servers to balance the load across your network. You can also separate your project i
nto multiple processes running on different machines. One process would be the actual application-server code and the other would be the data objects accessed through an object request broker. You can accomplish this using Visigenic's VisiBroker, which is included with Sapphire/Web, or you can use JavaSoft's Remote Method Invocation (RMI), the somewhat standard Internet InterORB Protocol (IIOP).
Sapphire/Web's high price may cause you to think twice about using it, but if you want to create excellent browser-based database applications, it will help you save time.
Andy Feibus is president of CustomBytes, an Atlanta software development firm. He can be reached at
amf@mindspring.com
.
uilding a database-driven Web application can be arduous if you try to do it from scratch using Java Database Connectivity with server-specific active page templates. This technique isn't portable, scalable, or easy. A more palatable option is the enterprise development and deployment environment Sapphire/Web 4.0, a $4,995 package from Bluestone Software Inc.
To transform the data into a particular format, you
can specify "Population Callback" functions for each data site. Sapphire/Web includes 30 Population Callback functions to perform many of the common transformations, including displaying each value as a link to another page, displaying a list of images that are links to other pages, or populating a drop-down list or an HTML table. Sapphire/Web includes the source code in both C and Java for modifying callbacks.
This Week's Issue
Technology Whitepapers
- Mobile BI: Actionable Intelligence for the Agile Enterprise
- Creating the Enterprise-Class Tablet Environment - by Yankee Group
- How To Regain IT Control In An Increasingly Mobile World - by BlackBerry
- Red Alert: Why Tablet Security Matters - by BlackBerry
- New Visual and Wizard-Driven Paradigms for Exploring Data and Developing Analytic Workflows











