Databases - Object Oriented Design

This is about how to design databases as a collection of objects.

Basically, a class defines some data elements and the methods (sub-routines) that manipulate that data.

In the case of a database, the methods are Forms, Reports, Queries, and other non-data pieces of the application. Typically, these methods read, write, print, and display the data stored in the tables.

The Tables are the class data definitions - each table is like a variable length array of related data. However, classes never store data, they just define its structure.

An object is an instance of a class. Only the object actually stores data, the class just defines how the data is stored. If several objects exist, each one has its own data, but there is only one copy of the methods.

There are significant differences between Paradox and MS Access. The following comments assume that froms and reports are developed on a separate development system and then delivered to the live system. (Never ever develop software on the live system.)
Paradox Uses an alias to access tables. Since these aliases can be re-defined programmatically, they can be used as object pointers.

Since each database is implemented as a subdirectory, updating a method is as simple as copying a file to the directory.

MS Access ODBC pointers can be used to access any table EXCEPT MS Access tables. Must use OpenDatabase to connect to a database via code. In Forms, the Record Source property can only be a Table or a Query.

Since each database is implemented as an mdb file, there is no way to copy a single method to an existing design. As a result, you need to replace the entire mdb file. If the data and methods where in the same file, this could never be done.

Paradox | MS Access | Delphi | Visual Basic | Java


Paradox

In Paradox, I base all the Methods (Forms, Reports, Queries ...) on aliases which are based on a user selection. Typically, these are re-defined before each Method is called.


MS Access 97


Delphi 5.0


Visual Basic 6.0


Java


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Databases / OO_Design.html