Go to the first, previous, next, last section, table of contents.

Names

In program generators there is the consideration of how to choose names for the various objects. The higher the complexity of the data structures the more distinct names have to be given to objects. There is always a tradeoff between highly descriptive names, which are long and thus hard to type, and short names which are easier to type but less descriptive. Even though program generators do well without descriptive names, the end user of the libraries which are to be built are human beings, programmers, for which the naming should be convenient. Because C++ allows overloading of functions names can be shorter without the risk of name conflicts.

Here we have make the following naming conventions. Classes for data types and segments are given the name of their two or three characters id in upper case, with the small qualifier `typ' or `seg' directly attached to it. Thus `NMtyp' is the class of numerics and `MSHseg' is the class of message header segments. Message classes are named a similar way by attaching `msg' to the uppercase letters which are taken either from the list of message type ids or from the list of event type codes(11). Note that we try to avoid using the underscore character `_', which tends to merely lengthen the name, readability can be acheived by altering uppercase and lowercase letters as well.

Instantiations of classes, i.e. variables as well as symbolic names of table values are given a name which is derived from the objects description. There is a simple fuunction which produces valid C names from arbitrary text strings. The function is given three arguments. the text string, the threshold length and the truncate length. All words in the string are concatenated with each first letter in upper case and all other letters in lower case. The words are truncated to the truncate length if they are longer than the threshold length. Typically the threshold length is greater than the truncate length, thus allowing short words to be completed while longer words to be truncated to a short length. For example if the threshold is 5 and the truncate length is 3 a description like "Patient Visit - Additional Info." becomes to `PatVisitAddInfo'.

This produces names which are sufficiently unique in most cases. However there are ambiguities in table values, which require a refinement of the name assembling algorithm. These ambiguities occur, when there are single words which begin with a common prefix like the latin preposition "intra" or the greek quantifier "milli". Thus "intravenous" and "intradermal" both become `Int'. This can be overcome by splitting such composite words into two ("intra venous" giving `IntraVen').


Go to the first, previous, next, last section, table of contents.