2017 October Release

Extending existing component objectsPermanent link for this heading

Fabasoft app.ducx allows you to extend existing object classes, enumeration types, and compound types that belong to another software component.

Cloud profile note: The extension of object classes, enumeration types, and compound types that belong to another non-friend software component is not allowed.

Extending an existing object classPermanent link for this heading

You can extend an existing object class belonging to another software component with new properties of your software component.

Please note that you cannot extend object classes not belonging to your software component with properties not belonging to your software component. However, you can reuse existing properties of your software component for extending an existing object class, even if the object class belongs to a different software component.

When extending an existing object class, be sure to add a reference to the software component of this object class. Otherwise, your project will not compile.

The extend keyword must be used for denoting an extension, followed by the class keyword and the reference of the object class to be extended. Then the new properties that should be added to the object class can be defined or referenced inside the class block.

Syntax

extend class reference {
  ...
}


In the following example, object class FSCFOLIO@1.1001:Organisation is extended with a list of projects.

Example

objmodel APPDUCXSAMPLE@200.200
{
  import COOSYSTEM@1.1;
  import FSCFOLIO@1.1001;

  class Project : CompoundObject {
    ...
  }

  // FSCFOLIO@1.1001:Organisation is extended with the object pointer
  // list
APPDUCXSAMPLE@200.200:orgprojects
  extend class Organisation {
    Project[] orgprojects;
  }
}

Extending an existing propertyPermanent link for this heading

The extend keyword followed by the keyword property and a block holding the properties allows you to extend properties of other software components.

Syntax

extend property reference {
  ...
}


A common use case for this feature is to extend the allowed object classes in object pointer properties of other software components

Example

objmodel APPDUCXSAMPLE@200.200
{
  // Extend compound type FSCFOLIO@1.1001:Address with a new string
  // property for storing the state

  extend property admobjchildren {
    allow {

      MyConfigClass;

    }
  }
}

Extending an existing enumeration typePermanent link for this heading

With the extend keyword followed by the enum keyword and a block holding the enumeration items, you can add enumeration items to an existing enumeration type belonging to another software component.

Syntax

extend enum reference {
  ...
}


When extending an existing enumeration type, be sure to assign integer values for the new enumeration items that will not conflict with possible entries that might be added in a future version.

For example, the enumeration type FSCFOLIO@1.1001:DocState already contains enumeration items with the integer values of 10, 20, 30 and 40. A logical continuation of this sequence would include the integer values 50, 60, 70 and so. Therefore, you should avoid these integer values when extending the enumeration type.

Example

objmodel APPDUCXSAMPLE@200.200
{
  // Extend enumeration type FSCFOLIO@1.1001:DocState with a new
  // enumeration item for approved documents

  extend enum FSCFOLIO@1.1001:DocState {
    DS_APPROVED = 30000
  }
}

Extending an existing compound typePermanent link for this heading

The extend keyword followed by the keyword struct and a block holding the properties allows you to extend compound types of other software components with properties belonging to your software component.

Syntax

extend struct reference {
  ...
}


When extending a compound type of another software component, reusing properties that belong to other software components is not permitted in the compound type.

Furthermore, be aware that compound types belonging to software component COOSYSTEM@1.1 cannot be extended.

Example

objmodel APPDUCXSAMPLE@200.200
{
  // Extend compound type FSCFOLIO@1.1001:Address with a new string
  // property for storing the state

  extend struct FSCFOLIO@1.1001:Address {
    string(2) addrstate;
  }
}