Record Classes

 The Record classes represent a record from the database.  Some of the record classes specify an actual physical record in the database while others correspond to a virtual record – the result of a join between tables.  These classes also follow an inheritance model similar to the Page classes.

Use the Record classes to modify the data access logic aspects of your application.

The PrimaryKeyRecord class is sub-classed for each table and then further sub-classed again.  The VirtualRecord class is used when a table join is specified, and the record does not correspond to a specific table in the database.

PrimaryKeyRecord Classes

A record in a database table is represented in the application as a class.  For example, if your application has a table containing a list of customers, Iron Speed Designer will create a class for the Customer record.  This class is derived from the PrimaryKeyRecord class and contains methods enabling the application to access and set specific fields within the record.  The primary reason for creating a class, instead of using PrimaryKeyRecord itself, is to create a set of methods that are specific to the record.  For example, instead of the application can make direct references to field names very simply, for example:

Rec.FirstName = “Alan”

Rec.LastName = “Fisher”

This makes the application more understandable and easier to maintain.

The lowest sub-class is considered the customizable class.  Iron Speed Designer does not overwrite files containing customizable classes.  Customizable class files are created once and are never overwritten by Iron Speed Designer.  Other classes are overwritten whenever changes related to the database table are made in Iron Speed Designer.  The class name is derived from concatenating the name of the table with the suffix “Record”.  For example, a table named Customer will have a record class called CustomerRecord.

The PrimaryKeyRecord class derives from the BaseRecord class and represents a record from the database. This class represents a record that can be updated in the database – since it has a one-to-one correspondence to a database.

VirtualRecord Classes

When multiple tables are joined together, a class derived from the VirtualRecord class is created.  The virtual record class allows your application to access fields from any of the database tables that were joined together.  For example, if an Order table was joined with the Customer and Product tables, the Virtual Record class or any of its derived classes will support the ability to access any of the fields of the three records.

The primary reason for creating a class, instead of using Virtual Record itself, is to create a set of methods that are specific to the joined record.  For example, instead of the application using the generic function called GetFieldValue, the application can directly reference specific field names, for example:

Rec.FirstName = “Alan”

Rec.LastName = “Fisher”

This makes the application more understandable and easier to maintain.

Iron Speed Designer creates an additional sub-class, called the customizable class, where you can add business logic without worrying about the files being overwritten.

The VirtualRecord class derives from the BaseRecord class and represents a record that is the result of a join of multiple tables from a database.  This class represents a record that cannot be updated in the database since it does not represent a specific record in the database.

See

<TABLE>Record Class

Base<TABLE>Record Class

BaseRecord class

See Also

Application Class Hierarchy