9.3 literals

OODBTG Reference Model

"Literals" are objects such as numbers and character strings.Literal values are similar to created objects in that both may occur asoperands of operations. Literal values are different from created objectsin that they have immutable state and they do not have a create operationbecause their representations are explicitly recognized. For example, multipleoccurrences of the same literal number are all references to the same pointon the number line. Operations which return literal values are constructingreferences to objects, not creating objects. In most object systems, ifX and Y are literals, X == Y only if X and Y represent the same literal.

OMG Core Object Model

4.2.4 Non-object types

Many object systems, for example C++ and CORBA, explicitly distinguishbetween objects and things that are not objects5.The Core Object Model has chosen to recognize that this distinction exists.Things that are not objects are called non-objects6.Objects and non-objects collectively represent the set of denotable valuesin the Object Model.

In the Core Object Model, non-objects are not labeled by an object reference,and therefore cannot be the controlling parameter for an operation request.Each non-object can be considered to belong to a type of value, calleda Non-object type. This is analogous to objects being instancesof types. Non-object types, however, do not belong to the Object type-hierarchy.Thus non-object types are not subtypes of Object. Moreover, the rules forsubtyping and inheritance defined later in this section do not apply tonon-object types. Components can add more structure to the non-object types;for example, a component could define subtyping and inheritance rules fornon-object types.

The Core does not specify a set of non-object types; these types aredefined in a component and chosen for inclusion in a Profile. For example,CORBA would define in its profile that the non-object types would include:Short, Long, UShort, Ulong, Float, Double, Char, String, Boolean, Octet,Enum, Struct, Sequence, Union, and Array. The set of non-object types canbe extended by adding new types to the Non-object component.

Editor's Note: Presumably, any operations defined for non-objecttypes would also have to be defined in components, since operations canonly be defined on object types in the Core.

Profiles can choose which non-object types to support. In a pure objectsystem, such as Smalltalk, all denotable values are expressed as objectsand so the set of non-object types may be empty. Thus profiles are allowedto make the difference between the set of objects and set of non-objectsthat they recognize as wide or as narrow as needed.

The set of all non-object types is called NTypes. The set ofall non-objects is called Nobj. The complete set of values thatmay be manipulated in the Core Object Model is described as DVal = Obj» Nobj. DVal can be thought of as thedenotable values in the Core Object Model. The elements of DVal are calleddvals. DVal is not a type in the Core Object Model. It does notexist as a supertype of Object and the types in NTypes. Therefore, youcannot specify, for example, an operation parameter that may be eitheran object or a non-object. This eliminates the difficulty of systems havingto provide run-time discrimination of objects and non-objects.

The remainder of this section deals primarily with objects. Unless otherwisenoted, when this chapter refers to type it means object type.

5 In the sense that objects have been defined inthe Core Model.

6 Examples of non-objects are the basic and constructedvalues as defined in the CORBA specification.


See entry under 7. Types and Classes.


Literals are immutable objects - either atomic (integer, float, Boolean,character) or structured. Structured_literals have two subtypes - Immutable_Collection(bit strings, character strings, and enumerations are built-in) and Immutable_Structure(date, time, interval). Additional subtypes can be defined, but operationson the built-in literal types cannot be redefined. The literal types areexpected to directly map to types in the programming language. If the languagedoes not have an analog for one of the literal types, the type must bedefined in a library provided as part of the language binding.


EXPRESS supports literals of all of the primitive types (integer, string,etc.), as well as enumeration literals.

Open Distributed Processing

Only objects are addressed, of which literals could be considered aspecial type of object.

Management Information Model

Abstract Syntax Notation One (ASN.1) [CCITT X.208] is the formal notationused to abstractly describe the syntax of information structures to beexchanged between managing and managed systems. It enables the definitionof types of information that need to be transferred using the CMISE services.The information model and the information associated with specific attributes,actions and notifications are definitively described using ASN.1. The full,detailed set of requirements for the operations interface, therefore, includesnot only the textual descriptions of the information model and the specificinformation of Actions and Notifications, but also their ASN.1 definitions.

The ASN.1 definitions used in a document that defines a management informationmodel using the GDMO templates are found in ASN.1 modules. ASN.1 modulescontain both type references and value references. In the GDMO templates,type references are used to define the syntax of attributes (includingpermitted values and required values which are subtypes of the attributetype), action information and reply syntax, notification information andreply syntax, and parameter syntax. Value references are used to definespecific values of defined ASN.1 types. In the GDMO templates, value referencesare used to define attribute default values and attribute initial values.


In SQL3, literals are used to specify non-null values. The rules forforming literals for the various built-in types are contained in the draftstandard [ISO96a]. ADTs do not have literal values. Row type literals areformed by concatenating values for the individual columns, as in:


Attributes values in Matisse can be literals or sets of OIDs. The usercan define constraints on literals which will be enforced by the database.Literals include the following types:


C++ supports all the value types provided by C, in addition to objects(instances of classes).


Ordinary COBOL literals are supported.


There are five types of literals in Smalltalk. Those literal types are:


Eiffel supports literals for the basic class types: INTEGER, STRING,REAL, CHARACTER and bit sequences. There is also a manifest form for ARRAY.


As noted under 2. Objects, Emerald objects may be defined asbeing immutable.

System Object Model (SOM)

SOM literal types are characters and integers.

Analysis and Design Methods

This concept seems to belong to languages and software construction,rather than to analysis and design.

features matrixintro page