Design notes

Accommodating CERN

The Data Access subsystem is subject to several design constraints because it is designed as an interface to the CERN library. For example, WebRunner Sample must "trick" the library into constructing a C++ object when it calls global callbacks such as HText_new2. These objects must translate hypertext functions such as HText_setStyle into operations on the THypertextScrapItem.

Encapsulated C library

All access to the network and the LibWWW is gatewayed through the TURL::Follow call. This shows one strategy for reusing existing code within a CommonPoint application. This design supports future modifications because none of the global variables or functions are used outside of this barrier. For example, this approach makes it possible to replace the existing library with CommonPoint-portable equivalents. The code in TURL::Follow and the LibWWW interface files can be replaced without affecting the rest of the system.

TScrapItem

TScrapItem provides a method to negotiate for an unknown piece of data. By using the dynamic cast interface in CommonPoint, a program can pass a pointer to TScrapItem in a typesafe manner to another program. In cases where complex data is being handled (such as hypertext), you can create a new scrap item such as THypertextScrapItem. When a simple, atomic data value like MGraphic needs to be transferred, you can use simple wrappers like TScrapItemOn<MGraphic> to facilitate type negotiation.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker