Skip to content

Customizing the Data Dictionaries

In this section, you will customize all of the Data Dictionaries for the Order Entry sample application. In the process, you will learn how to define both simple and complex business rules in Data Dictionaries.

Important!

In order to complete the pages in this tutorial section, you must have at least one Windows application in the OrderTutorial workspace. Create a Windows application named Order.src.

For a refresher on creating Windows applications, complete the Creating a Windows Application and Compiling and Running a Windows Application pages now, and then return to this section and continue where you left off.

Skipping this Section

If you wish to skip this section of the tutorial, the manual creation of Data Dictionaries, you may instead copy the DDSrc folder from the Order Entry sample workspace to the OrderTutorial workspace. Make sure neither the OrderTutorial nor Order Entry workspaces are open in the Studio when copying the DDSrc folder, and that you have backed up the OrderTutorial workspace, just in case.

Taking this action will provide you with a complete set of Data Dictionaries for this workspace.

Note

You can use the Order Entry sample workspace to compare and debug your code. Run the Order Entry samples; adding a few orders and examining this sample will give you a better understanding of the manual code added during the tutorial.

Data Dictionaries

Data Dictionaries (DDs) contain business rules. These business rules can be generic rules that apply to any table, or rules for a specific table. Creating a Data Dictionary in the Studio defines a class.

Data Dictionary Classes and Objects

DataFlex is an object-oriented language. When you create a Data Dictionary for a particular table, it creates a DataDictionary class from that definition. When you create a component (e.g., a view or report) in the Studio that uses a table, the Studio creates a Data Dictionary Object (DDO) in that component based on a DataDictionary class.

For example, we will create a class for the Customer table named cCustomerDataDictionary. The Studio will create an object named oCustomer_DD based on this class when you create a component that uses this DataDictionary class for the Customer table.

You can create multiple DataDictionary classes with varying business rules for any given table, or even multiple layers of classes that inherit from the top class down, but this sample will focus on a single DataDictionary class per table.

The default extension for DD class files is .DD. Typically, only one DD class is defined per .DD file. We suggest that you conform to this rule to enable the Studio to model your DD classes.

This tutorial section will take you through the following steps:

The creation of each Data Dictionary will introduce and walk you through various Data Dictionary concepts: