Delphi Data Base Application checklist

 

Modeling phase

Define your data base model.
Make the formal application model, if such advanced methods are used.
 
 

Technical considerations

Database

Work through the SQL Query and transaction cases. The Borland Database Explorer should be used as a reference tool during all work. It is also convenient to construct a dialog window that optionally shows all SQL-statements performed within the application at any time.

Decide upon use of stored procedures and other advanced database utilities. Test the Delphi implementation.

Test BDE and/or ODBC functionality for the database selected. National characters, sort order, delimiters, data type differences, treatment of 'blob' fileds, transaction control from the Delphi side, limitations in SQL implementation, etc.  All products on the markets differ on closer scrutiny. Work-around the parameter subsitution devices of Delphi if needed.

Plan and design classes for caching and manipulating data in the application  form units while displaying and in internal memory. The objective may either be true object orientation separation or equally important: utilities making coding more compact, revisable and self-checking.

You might need general classes for insert, change and delete of data. Timestamp and similar devices can be integrated.
 
 

Delphi/Windows techniques

Isolate potential combined Delphi/Windows controls typical for the application and build Delphi classes/components with visual, logical and data access functionality. This is the crossroads where your project makes its most vital choice.

Classes and components could for instance be: Date controls, comboboxes with picklists, buttons receiving messages, grids, component groups with standardized appearance or any control with important visual design, variables or data access contained.

Assembling or modifying standard Delphi components:
 

Design base classes of  TForms, containing visual design standards, exit rules, status bars, resizing, memorized sizes, buttons etc.

Have a plan for common variables, windows messaging methods and flags or triggers for deferred actions within the application.

Use purchased components or freeware if they  add substantial value. Do not use them if you with reasonable effort can make own solutions. Foreign programming, even if very smart, may bring you into troubles. Even bundled products like QuickReport may turn out as quite a bit less reliable than the standard Delphi toolbox.. Own mistakes are easier to live with than those of others. The worst thing that you can get into is a general instability in your environment caused by some unknown lack of strictness.
 

Programming work

Organize the work to minimize the number of source code units shared between several persons. The include-directive for source code may be helpful.
 
 

Testing

When testing the application, use a debug tool that traces memory leaks. These are usually caused by omitted or not correctly implemented destroy procedures in own components.

Generally:  Load and free forms when needed. If possible, create and free objects like a TQuery within the block. The more extended the lifetime of your objects, the bigger the risk to get problems because of hidden interrupts in the execution flow, etc.

Use the ComponentState property to read pending destroy status if you create and free objects systematically.

Do not mingle to much with the Windows internal flow of action - trying to prevent some actions from running more than once seldom succeeds. The same applies to the basic  idea in Windows that the user triggers the action: Attempts to move the cursor around and driving the form windows programmatically too much will cause problems like uncontrolled loops.
 
 

Gunnar Sommestad    98-03-23     http://sommestad.com