ABSTRACT operator
The ABSTRACT operator creates an abstract property.
Syntax
ABSTRACT [type [exclusionType] [order]] [FULL] returnClassName [(argClassName1, ..., argClassNameN)]
Description
The ABSTRACT operator creates an abstract property. Its implementations are added later by += statements. Depending on the selected type, the platform builds from them the behavior of a selection operator.
The ABSTRACT operator cannot be used inside expressions.
Parameters
-
typeOption. Possible values:
CASE- the explicit conditional form of the abstract property. The selection condition of each implementation is defined in the corresponding+=statement using theWHENblock.MULTI- a polymorphic form of the abstract property. An implementation is selected when the current arguments are compatible with its signature.VALUE- the polymorphic value-based form. An implementation is considered matching if it returns a defined value, that is, a non-NULLvalue.
If this option is omitted,
MULTIis used by default. -
exclusionTypeOption. It specifies the type of mutual exclusion. Possible values:
EXCLUSIVE- the mutually exclusive mode for theCASE,MULTI, andVALUEforms. In this mode, for each set of arguments there must be at most one matching implementation.OVERRIDE- the mode for theCASE,MULTI, andVALUEforms in which several implementations may match simultaneously.
Used only with
CASE,MULTI, orVALUE. ForMULTI,EXCLUSIVEis used by default; forCASEandVALUE,OVERRIDEis used by default. -
orderOption for
OVERRIDE. Possible values:FIRST- new implementations are added to the beginning of the list, so the last added implementation will be selected. If this value is not specified afterOVERRIDE, it is used by default.LAST- new implementations are added to the end of the list, so the implementation added first will be selected.
Used only with
OVERRIDE.The addition order across modules is the module initialization order: implementations from required modules are added before implementations from the modules that depend on them, and within one module — in the order they appear in the source.
-
FULLKeyword. If specified, the platform automatically checks the completeness of implementations: for all descendants of the argument classes there must be at least one applicable implementation, or exactly one if the conditions are mutually exclusive.
-
returnClassNameClass of the return value of the property. Class ID.
-
argClassName1, ..., argClassNameNList of class names of property arguments. Each name is defined by a class ID. The list may be empty. If the list is omitted, the parameter classes are taken from the property declaration in which the
ABSTRACToperator is used.
Examples
CLASS Invoice;
CLASS InvoiceDetail;
CLASS Range;
CLASS Connection;
rateChargeExchange(invoice) = ABSTRACT NUMERIC[14,6] (Invoice);
defaultIsMobileMode(Connection c) = ABSTRACT BOOLEAN;
backgroundSku 'Color' (d) = ABSTRACT CASE FULL COLOR (InvoiceDetail);
overVAT = ABSTRACT VALUE OVERRIDE FIRST Range (InvoiceDetail);