[Top] [Prev] [Next] [Bottom]
[Contents]
Client-Side Programming Advantages
The importance of client-side programmability in Web application development cannot be overstated. If it is not on your "checklist," add it. As a simple example the statement:
i++
in Java runs in less than a microsecond and uses only the client machine's resources. To perform the same instruction on the server-side requires many computers and networks plus many instructions on the server to perform the same task. As a guess the difference in resources on an Intranet may be a billion to one.
Sapphire provides a Java framework. At the heart of the framework is the class
Sa.SaJavaRowSet
This class provides a programmable object in the client browser. The framework is built around this class. As you will see later in this book, you can design a Web application with this framework without writing a single line of Java, C/C++, or HTML. The application can display a master row set and as many drill down detail sets as needed. Each can perform insert, update, delete, login, and refresh.
In addition, this Java framework is extensible. For example, you could add you own generic view classes (inherited from the Sapphire base classes). These can then be used by others in your development team, who will again have to write no further lines of code. All that is needed is to add a parameter tag to the applet, and the Sapphire framework will load the your view class dynamically.
This allows capabilities to be added to Sapphire/Web with no changes to the tool by developers, third parties, and Bluestone. You can design view classes by plugging in existing Java classes (spreadsheets, graphics, statistical analysis). The Java framework provides mechanisms to make this easy and transparent. You can even design your own framework from the Sapphire base classes. You can design classes using your favorite Java development system (Visual J++, JDK, etc.). The framework is compatible with emerging Java technologies: JDBC, Java IDL, Java RMI, and Netscape ONE Internet Foundation Classes (IFC).
Furthermore, various parts of the framework are already compatible with the emerging Scriptable Java, sometimes referred to as Java Beans.
The applet Sa.SaRowSetControl
is a scriptable Java Data Control. Sapphire provides both JavaScript and VBScript frameworks that integrate this control with any HTML form.
Sapphire provides an ActiveX control which implements a row set over the Internet. The control can provide insert, update, delete, login, and refresh. The control provides a "scriptable" and programmable interface through ActiveX technology. Sapphire provides both JavaScript and VBScript frameworks that integrate this control with any HTML form.
The final Sapphire client-side object is a row set implemented in JavaScript. The JavaScript row set provides "scriptability" in both JavaScript and VBScript. To implement insert, update, delete, login and refresh requires hooking it up to an HTML form (more work from the developer). A major advantage is the ability to save the HTML page to disk, disconnect from the network, and be able to reload a working application into a browser.
The ActiveX control can provide the same capability. Currently the Java framework cannot due to the Java implementation rules currently in use by both the Netscape and Microsoft browsers (this will probably change).
The Java framework and ActiveX Control integrate in exactly the same way with the server application. This is no accident. In fact, a server application which does insert, update, delete, and login for a data source can service Java rowsets (master and detail) in all Java enabled browsers as well as the Sapphire ActiveX Control embedded in any ActiveX enabled browser, Visual C++, Visual J++, Visual Basic, Word, Excel, Access, any OLE container capable of hosting OLE controls, and any application which supports VBA.
You can add all the business logic to the server application and encapsulate what it means to work with the data source. Each client-side view can have its own presentation logic. Each view can integrate with all Java classes, all ActiveX controls, all the current scripting tools which work with ActiveX, and all the hosting applications and their capabilities.
- Note: You can port server applications between all platforms that Sapphire is available on. These applications can serve the Sapphire ActiveX control, for example, even if the server application is deployed on a UNIX machine.
Client and Server Object Compatibility
All these client-side objects that we have spoken about will work with any of the following server-side objects that Sapphire delivers:
Sapphire/Web also provides a great development tool to develop traditional server-side programming.
Sapphire/Web is based on an open and versatile architecture. The tool works with any web server, web browser, HTML editor, and source code control system. You can add tools directly to the Sapphire menu system. This capability is important. If the best WYSIWYG HTML editor ever written was to suddenly appear tomorrow, Sapphire/Web enables you to easily integrate it into its IDE. With other tools, you may be stuck using an old, less productive editor.
Sapphire/Web provides the capability of developing traditional HTML and server applications, but Sapphire/Web is not limited to just these. Sapphire/Web has popularized the concept of template files, where data is melded into the template file producing virtual documents. Sapphire/Web template files do not need to be HTML, however.
You can use VRML, for example. You can generate the entire return document in code using your own or supplied server objects. You can develop templates or code which defines new protocols based on HTTP to enable new client objects.
Furthermore, you are not just limited to HTML forms and anchors as activator types, but you can define your own. The Sapphire client objects use this mechanism. You can also use VRML in-lines and anchors as well as frames and the new MAP tag. You could use JavaScript or VBScript elements as activators. You can develop your own activator types for use with the new client objects.
Sapphire/Web uses the concept of "population callbacks." These callbacks allow you to properly separate the data from its display. Why is this so powerful? It enables you to achieve an incredible level of polymorphism, object reuse, and encapsulation. If you design a population callback that say populates a VRML graph, that callback can be applied to all of the other server objects, without any change to the server object or any knowledge of the new population callback by the server object. If you need a new protocol for client display, add a population callback-all server objects can be used with it. If you develop or purchase a new client object then all server objects can be used with it.
For example, using Sapphire/Web population callbacks, you can "populate" the parameter value tag of a ActiveX control or a Java applet with data from a server object. Sapphire/Web had this capability in its initial release. Note, that some tools may offer this as a client side solution. Although nice and sometimes useful, it is hardly a solution for real client development. Unfortunately, there is no standard data format among data objects and you may end up writing many of these population routines as new objects are needed. Also, these routines are error prone, since you must "escape" many different characters which are not allowed in the values tag in an HTML page. Worse yet you will find that many application designs require the user to keep reloading the page with this technique to simulate client programming. This is inefficient. You also cannot build frameworks around this approach as you can around the Sapphire/Web client objects approach.
The Sapphire/Web client objects provide a means to build application frameworks. A framework provides the developer with almost all the code and pieces to develop an application. The pieces that may be needed are usually a GUI dialog editor and some clicks in a visual tool. Sapphire/Web provides frameworks based on its client objects. With the Java classes and ActiveX control provided by Sapphire, you can build Web client-server applications with no coding at all. But Sapphire also lets you add code to customize each application.
Sapphire also allows you to extend our frameworks or build your own frameworks. These can be plugged into the tool with no change to the tool. Developers can then use these new frameworks to develop applications with no coding. Sapphire will deliver new frameworks using this same capability.
[Top] [Prev] [Next] [Bottom]
[Contents]
info@bluestone.com
Copyright © 1997, Bluestone. All rights
reserved.