DBMS

Data Director 2.0

By Steve Roti
DBMS, November 1996 CenterView Data Director 2.0 (formerly known as Choreo) is an integrated client/server development extension for Microsoft Visual Basic 4.0.

Visual Basic has been a popular development environment for years now, and it is used for everything from quick-and-dirty single-user applications to sophisticated commercial software products. Because it's a general-purpose tool, it appeals to a wide ra nge of developers. That same breadth of appeal also means that in the database area, Visual Basic lacks some of the specialized features of products such as PowerBuilder and SQLWindows.

This is where Data Director 2.0 from CenterView comes in. Formerly known as Choreo, Data Director is a tightly integrated development extension for Visual Basic 4.0 that adds both design-time and runtime functionality. At design time, Data Director seaml essly extends the Visual Basic development environment, providing additional functionality through menus, dialogs, controls, and palettes. At runtime, it manages all SQL commands, data synchronization, and display, through what CenterView calls a model-d riven data access engine.

Does every developer building a database application with Visual Basic 4.0 need Data Director? The answer is no: Not all developers will choose to work in a model-driven environment, and not all applications can be built with non-procedural tools. Howeve r, many applications are candidates for Data Director, such as those in which the developer would rather not write SQL code to access the database and would rather have multi-user concurrency issues handled automatically. This situation implies a well-de signed database with all necessary primary and foreign keys defined in the schema and no show-stopping performance issues that require hand-tuned SQL to achieve adequate response time.

Three terms must be defined in order to understand how Data Director works: Models, DataGroups, and DataLinks. By way of analogy, a Model is similar to a database schema, a DataGroup is similar to a view, and a DataLink is similar to a column in the sele ct list of a query.

Models

A Model is a "snapshot" of the physical structure of a database and is made up of elements - tables, columns, and relationships - that describe the database structure in entity-relationship terms. Most of the design-time and runtime functionality that Da ta Director provides to applications is based on a Model, rather than being based on the system tables or catalogs in the underlying database.

To create a Model of a database, Data Director imports schema information from a wide variety of SQL DBMSs. The Model stores information about the database characteristics such as table names and column data types, which columns are primary keys and whic h are foreign keys, and how the tables in the database are related to one another. Models are stored in both text (.MLT) and binary (.MLX) file formats, and Data Director uses the text Model file at design time and the binary Model file at runtime. This structure means that any applications built with a given Model must be distributed with the appropriate binary Model file. When the structure of a database that has been imported into a Model changes, it is necessary to synchronize the information in the database and the Model. Data Director has the ability to refresh a Model with any changes that have occurred in the underlying database.

The Data Director user interface for working with Models is called the Model Viewer. Figure 1 is an example of the Model Viewer showing the tables in a Model, the relationships for a selected table, and the properties for a selecte d column in the table.

DataGroups

A DataGroup is a collection of related tables that coordinates the usage of data across many database tables and many application windows. DataGroups enable users to complete data usage tasks such as querying or saving data across an entire application ( not just for a single application window).

Each DataGroup contains a subset of the tables in a Model, and the Model determines which database to access. The same Model may be used for more than one DataGroup, and an application may access multiple Models. Generally, a DataGroup is based on one bu siness process. The number of processes an application performs usually determines the number of DataGroups in that application. For example, an order entry DataGroup might include tables named customers, orders, and order_lines.

A wide variety of properties can be defined to control the behavior of a DataGroup: General, Query, Error Handling, Database, Connection, Concurrency, BLOB Support, and Joins. Figure 2 shows the options for the Concurrency properti es of a DataGroup.

DataLinks

In addition to being an interface to a Model, a DataGroup also stores a group of DataLinks. DataLinks are the connections between database columns and Visual Basic controls. A DataLink coordinates data between a database and an application and tells Data Director where data should display in the application.

When you create a DataLink between a text box named Employee Name and a database column that stores employee names, the text box displays employee names in a running application.

Because a DataGroup references a Model, Data Director automatically knows about the relationships in the Model. For example, a one-to-many relationship in a Model tells Data Director to query the detail information for the master records if DataLinks to the detail records exist.

The Data Director user interface for working with DataLinks is called the DataLink Manager. Figure 3 shows DataLinks on the right-hand side of the DataLink Manager window, with mapping between controls on a Visual Basic form and co lumns from three tables in a DataGroup named CustomerService.

The Data Director Engine

The Data Director engine is a model-driven runtime SQL engine that automates data management functionality, including data access, data synchronization, and multi-user concurrency. The engine provides data management functionality by generating database- specific SQL commands and managing all client/server interactions for Windows 95 and Windows NT workstations. The Data Director engine can also support multiple database connections to any ODBC-compatible data source over both LANs and Intranets. The run time engine must be distributed with any applications built using Data Director. The engine may be freely distributed with no runtime licenses or fees.

Lights, Camera, Action . . .

CenterView has done an impressive job of integrating its development environment with Visual Basic 4.0 and has added quite a bit of functionality to VB for database application developers. I found CenterView's Model Viewer and DataLink Manager easy to un derstand and use under Windows NT. (I didn't have the opportunity to test it under Windows 95.) For Visual Basic developers who don't want to write SQL code and who want a runtime engine to handle multi-user concurrency issues, Data Director 2.0 is an at tractive tool.


Figure 1.


The Model Viewer showing the columns in the Products table, its relationship to other tables, and the properties of a selected column in the Products table. In this case, the ProductID column is a system-generated primary key stored as an integer.


Figure 2.


The DataGroup Properties showing the Concurrency properties for a DataGroup named Orders. Data Director can enforce optimistic or pessimistic update concurrency, with the additional option to detect update conflicts if optimistic concurrency is chosen.


Figure 3.


The DataLink Manager showing links between Visual Basic controls on a form and columns from a DataGroup named CustomerService. Note that the columns are drawn from three different tables within the DataGroup.


Steve Roti is the owner of Olympic Software, a database consulting firm in Portland, Oregon. He is an active user of SQL DBMSs on Unix, VMS, Windows, and Macintosh. You can email him at 70323.3614 @compuserve.com.
Subscribe to DBMS and Internet Systems -- It's free for qualified readers in the United States
November 1996 Table of Contents | Other Contents | Article Index | Search | Site Index | Home

DBMS and Internet Systems (http://www.dbmsmag.com)
Copyright © 1996 Miller Freeman, Inc. ALL RIGHTS RESERVED
Redistribution without permission is prohibited.
Please send questions or comments to dbms@mfi.com
Updated Wednesday, October 23, 1996