borland Packages  Class Hierarchy  dx.dataset Package 

DataModule interface

com.borland.dx.dataset.Designable
   +----com.borland.dx.dataset.DataModule

About the DataModule interface

The DataModule is an interface that you implement when creating your custom data module class. Data modules (often referred to as data models) are specialized containers where data access components and their associated properties are collected into a reusable component. You define your data module once, then use it among various applications, or various frames within a single application.

The data module also provides a centralized location where "business logic" can be stored. "Business logic" describes the rules by which data is manipulated before and after the user (or client) sees the data. Business logic may include default values, filter criterion, constraints on data insertions, and so on. By encapsulating such logic in a single location, you are assured that every application that uses your data module provides consistent business logic.

The DataModule interface does not contain any variables, properties, methods, or events, however, by implementing this interface, you implicitly declare that your class is a data module.

When referencing your data module in your application, you can access a single instance of your data module shared across your application instead of allocating memory for multiple instances. To do this, your custom data module class should define a public static method that retrieves the current instantiation of the data module. This same method should also create and return a new instantiation if one doesn't already exist. For an example of this code, use the Data Module wizard to create a data module and examine the logic of the code it generates.

Tip: When working with DataModules, you must compile your DataModule class before it can be referenced in your project.