Inheritance and Compilation of Migrated Entries

Depending on how you have configured the Uniface IDE during migration, entries may be inherited or overlaid in Uniface 10, where this was not the case in Uniface 9. This can result in functional changes in the application.

Generated Pre-Compiler Directives

By default, the migration utility generates pre-compiler directives to ensure compatible behavior between Uniface 9 and 10, which can result in extra, and perhaps unnecessary, code in your application.

If you know that you are not affected and do not want to add unnecessary code to your application, you can prevent this behavior by setting the logical MIGRATION_SCRIPT_V9_INHERITANCE=0 in the assignment file. If you do so:

  1. Review possible differences between compiled entries in Uniface 9 and 10.
  2. Manually correct possible compilation errors and changes in runtime behavior arising from the following:
    • Entries migrated from standard triggers and Local Proc Modules may be inherited.

      If multiple entries with the same name are inherited, entries will be overlaid, as only one can be compiled. If not overlaid by a locally-defined entry, these entries are added to the locally defined entries. If the entries are never called, no functional changes will occur, but they may result in additional compilation warnings and errors that need to be fixed.

    • Inherited entries may now overlay other inherited entries that were not overlaid in Uniface 9, or were overlaid by another entry.

      In this case, the application behavior may change, and you will have to fix it. The Uniface 9 compiler already warns of potential inheritance differences, so you can refactor your code in Uniface 9 before migrating it to Uniface 10.

Entry Inheritance in Uniface 10

The order in which code is inherited and compiled has changed between Uniface 9 and Uniface 10. For triggers and operations this has no impact, the result after compilation will be the same as in Uniface 9. For entries, however, this might have an impact.

In Uniface 10, an entry cannot be overlaid by an entry with the same name defined on a more generic layer. The specialization always wins. This is best explained using an example.

Entry Compilation and Inheritance in Uniface 9 and 10

Entry inheritance and compilation

  1.    In Uniface 9, entry log is defined in the Local Proc Modules container of a modeled entity.
  2.  An entry with the same name is specified in the Local Proc Modules container of a component.
  3.   The component uses the modeled component in its structure and therefore inherits from it.
  4.  In Uniface 9, container inheritance is applied before overlaying duplicate entries—the Local Proc Modules container inherits all content from the modeled entity because no local content is defined in the container at component level.
  5.  The entity appears at a lower level than the component node itself, so the inherited entry log will overlay the definition defined locally in the component node.
  6.  In Uniface 10, entries are concatenated based on specialization order, so generalization first followed by the specialization.
  7.   The locally-defined entry log overlays the modeled entry definition. This causes a functional change.