Previous Table of Contents Next


6.10 Name Scope Optimization

   Names of packages, associations, and classes in the MOF include all of the information about the concept’s scope. This fully qualified name consists of a number of scope-level components, separated by dots. For example, an attribute contains information about which class it is in, and what package that class is contained by. However, while this scope information is necessary in the broader picture, these names provide more information than is necessary to uniquely identify a model concept within the model.

   The names of packages, associations, and classes are therefore optimized to make them as short as possible while still being unique within the domain model. (Since attribute names are unique within their class, they are simply represented by their local name). This is done as follows. First, a set of all names is assembled, and each is broken down into a sequence of words (one for each scope level). A possible scoped name is then created for each name, constituting the last word of the word sequence for that name. If this possible name is unique within the set of possible names, then it is accepted as the scope-optimized name. If not, then the process is repeated with the last two words of the name sequence. This continues until all names have been optimized. Table 6-2 presents an example of a set of names and their reductions.

Table 6-2 An example of some name optimizations

Fully Scoped Name Scope-Optimized Name
Genealogy.Family.Child Family.Child
Genealogy.Family.Father Father
Genealogy.Tree.Child Tree.Child
Genealogy.Tree.Branch Genealogy.Tree.Branch
Flora.Tree.Branch Flora.Tree.Branch
Flora.Flower Flower