Description


These precompiler directives allow additional coding without breaking inheritence. #IncludeInherited adds the inherited sourcecode (model,template) for this trigger and object (entity, field, form) #IncludeDefault adds the current default sourcecode for this trigger and object (entity, field, form) To ease overwriting of entries, the compiler should IGNORE multiple entry definitions and just take the first one.

Use Case


#includeinherited: I just want to extend/overwrite a modeled entry, but want to keep inheriting all other entries. #includedefault: Allows a FLEXIBLE reference to the defaults, and a chance to supersede replace modeled entries with the default set.

Importance


adding these precompiler directives makes it much easier to extend (and overwrite) inherited code. See the lot of discussions how to guarantee inheritance when modifying a single entry.

Type


Uniface 4GL

Operating System


Not Applicable

Status


2 thoughts on “#includeinherited and #includedefault”

  1. In Uniface 10, the granularity of inheritance has changed so that only proc modules defined within the derived object overrides the inheritance from the modelled object. All other modules continue to maintain their inheritance unless specifically “undeclared”. If the module is defined multiple times in a single code container, then only the last one is included. I believe the result of this change gives the functionality requested in this wish.

  2. Unfortunately, as we have seen, the way U10.3 handles modeled inheritance
    by processing the complete modeled container before the local container is parsed
    causes problems with “guarded” codes as the precompiler directives are not overlayed.

    Processing local code first, modeled second and keeping only the first definition will
    handle even the precompiler statements as intended.

    And #includeDefaults should place the standard code of the trigger in my own code,
    so I can extend the processing (even the one executed for an empty trigger like PRNT)

    thanks for taking your time to go through the old wishes,
    Uli

Leave a Reply