Using Enumerated Types as Extensions of Primitive Types

A BOM Primitive Type, of any type (superclass), can be mapped as a Generalization of an Enumeration in order to extend the primitive type’s range of possible values.

For example, the following illustration shows an Integer primitive type, Speed Limit. The possible kinds of Speed Limit are given as enumeration literals within an Enumeration called Legal limits. The value of each of these enumeration literals is an integer representing the speed limit currently in force in the circumstances described by the enumeration literal. For example, the literal Motorway has the value of 70, because the speed limit on motorways is 70 mph. If this speed limit were to increase to 80 mph, for example, the value of this literal could be changed to 80.