Understanding File Buffers and DDO Field Buffers

Before you can access information from a table it must be opened. When a table is opened a file buffer is created. Data in this buffer is accessed using the File.Field variables.

Open Customer


Move Customer.Name to sName

Move sName to Customer.Name

A file buffer is global and only one instance of a table can be opened at one time. This means that there is only one instance of any File.Field variable.

When a Data Dictionary object is created, the table used by that DDO is opened which creates access to the same global file buffer. Since you are allowed to have multiple object instances of the same Data Dictionary in an application, DDOs must provide a method to access data this is just local to itself.  It does this by creating local DDO-Field buffers. These field buffers allow you to work around the restriction of a global file buffers. DDO can contain unique field data, even if they refer to the same table.

Get File_Field_Current_Value of hoDD File_Field Customer.Name to sName

Set File_Field_Changed_Value of hoDD File_Field Customer.Name to sName


Get Field_Current_Value of hoDD Field Customer.Name to sName

Set Field_Changed_Value of hoDD Field Customer.Name to sName

At a low level, Data Dictionaries are restricted to using global file buffers. They are specifically designed to deal with this (see Synchronization of File Buffers and DDO-Field-Buffer). As long as you use DDO-Field buffers, the complexity of dealing with global file buffers is hidden from you.

When working with Data Dictionaries you can access table column data by referring to the Table’s File-Buffer or by referring to the Data Dictionary object’s DDO-Field-Buffer. As a developer, you need to know when you can and should use each type of buffer.

In some cases it does not matter which method you use, and you can use whatever is simplest (usually File-Buffer), while at other times it is critical that you use the right method. Here are some guidelines to assist you in choosing the proper coding style.

See Also

When to Use the DDO-Field-Buffer

When to Use the File-Buffer

Synchronization of File Buffers and DDO-Field-Buffer