File Children

  

DEVELOPER

A commonly used technique in PROIV is to set up multiple file definitions pointing to one physical file. These will often have slightly different variable names, so that if a file needs to be accessed in more than one place in a function, it is always certain where the data has been read from, and where it will be written to.

The drawback to this technique is that any change to one file definition means that all the others need to be changed in the same way to keep them in step. This is a maintenance overhead, and also involves risk, since if any mistakes are made, data integrity can be compromised.

File Children make this technique safe and easy. They consist of file definitions that are automatically kept in step with their master file definition, needing no maintenance, and with no risk of being out of step.

File children are defined with an explicit character string (in the format ‘_x’) that is appended to all of the master’s variable names, so when the child is used in a function, it is easy to know what the variable names must be. There is no rule as to what the Child’s file name must be (beyond the normal file naming rules), but if your naming standards allow it, it is a good idea to follow the rule:

Child File Name = Master File Name + Suffix Character

e.g.

Master File

=

INVOICE

 

Suffix

=

_1

 

Child File

=

INVOICE1

When used in functions the File Child is like any other PROIV Developer file definition.

Any existing file definitions (including SQL maps, but not C-ISAM maps) can be masters.


 

Comment on this topic

Topic ID: 500143