Share

Migrating Clarion applications to .Net

These are basic outlines and Ideas I have been playing with, but never got the chance to implement.

Why migrate?

Productivity

There is no question that the rich class libraries available in .Net will make any programmer more productive. Take for example the string handling routines including regular expression support, or the simple file-system-IO classes. The OO features also allow some architecture to be built instead of the procedure-based spaghetti.

Scalability

The cursor-like record based database routines in Clarion will become problematic when the user base grows and the performance may be extremely dependent on network latency. Clarion’s built in templates by default have 3 retry’s when it comes to generating auto increment fields (this happens on the client side!). In custom code the retry’s are often omitted.

Sanity

The Clarion client-side Referential integrity can never guarantee the referential integrity of the server side database. Lost connections lead to partial transactions that will not roll back.

The Referential Integrity problem

Adding constraints to the database layer will in most cases break the standard Clarion templates. In order to keep the Clent-side RI intact while working on the same database, a middle layer is needed. ADO.Net is the perfect solution for this.

It should not be difficult to generate strongly typed DataTable classes including constraints from Clarion’s DCT using a Clarion template.

Replacing Templates

With rich OO features in .Net it’s trivial to create base classes that mimic the Clarion templates. For a “browse” template I would create a control that inherits from DataGrid. Many “features” of the Clarion templates should actually rather be disposed of. The standard scrolling and selection capabilities in .Net are far superior to the Clarion templates.

Selection windows are a good candidate for a single implementation using a generic class inheriting from Window and taking a generic argument of a DataSet. The original code base would shrink dramatically!

public class SelectBrowse<T> : Form where T : DataSet{
...
}