The ANY type was defined in CCITT Rec. X.208.
The normal use of
the ANY type was to leave a "hole" in the specification which would be
filled in by some other specification. The notation was "AnyType", allowed as an
alternative for "Type", and specified as:
AnyType ::= ANY | ANY DEFINED BY identifier
It was strongly
recommended that the second alternative of the notation be used. In this
alternative, only allowed where the
ANY type was one of the component
types of a set or sequence type, some other component of the set or sequence
(that with the referenced "identifier") would indicate, by its integer or object
identifier value (or a choice of these), the actual type governing the any
component. The mapping from such values to particular ASN.1 types could be
viewed as some sort of "table" which would form part of the abstract syntax. In
the absence of the "
DEFINED BY identifier" (the first notational
alternative), there would be no indication within the notation of how the type
of the field could be determined. This frequently led to specifications where
the "hole" continued to exist even at the stage where implementations were
expected.
The
ANY type has now been superseded by the ability to
specify information object classes and then to refer to the fields of
information object classes from within type definitions (see ITU-T Rec. X.681 |
ISO/IEC 8824-2). Since fields may be defined to allow an arbitrary ASN.1 type,
the basic ability to leave "holes" is provided. However, the new feature also
permits the specification of a "table constraint", wherein a particular
"information object set" (a set of information objects of the appropriate
information object class) is explicitly cited as constraining the type. This
latter capability encompasses that offered by "
ANY DEFINED BY
identifier".
In addition, some pre-defined uses of the new capabilities
are provided (see ITU-T Rec. X.681 | ISO/IEC 8824-2), which correspond to
various commonly occurring patterns of use of the any type. For example, a
sequence containing an object identifier and an any, often used previously to
convey some arbitrary value together with an indication of its type, can now be
described as:
INSTANCE OF MUMBLE
where "MUMBLE" is defined as an information object class (not as an
ASN.1 type):
MUMBLE ::= TYPE-IDENTIFIER
This notation causes "INSTANCE OF MUMBLE" to be replaced by an
object identifier for an object of class MUMBLE, together with the type
identified by the object identifier. See ITU-T Rec. X.681:2002 | ISO 8824-2
(2002), E.2.18 for an example.
Particular pairings of object identifier and
type are defined as information objects of class MUMBLE, and, if
required, particular sets of these can also be defined and used to constrain the
INSTANCE OF construct so that only those objects in the set can appear.
The macro capability was often used as a semi-formal way of defining tables
of information objects to govern an associated use of an any type, and is also
superseded by the new capabilities.