Impressum / About          Start page

Section Computer Science - Noncommerial pages


Terms of object oriented programming in typed languages

This glossary defines the terms that are used in my articles. Unfortunately, terms in the area of object oriented programming are often quite fuzzy or do not have a unqiue meaning. Other required precise and short terms are totally missing and would have to be paraphrased.

Deep immutable object

An object O is deep immutable if its visible state is immutable and if the visible state of all objects that can be reached from O by visible references is immutable.

Defining type of an object

The type that was used to create the object. An object may be an instance of multiple types but it has always one defining type.

Entity object and entity object type

An entity object is an object whose identity matters. The state of an entity may change in time. Entities can be distinguished by their identity. An entity object is the opposite of a value object.

An entity object type is a type species that defines objects to be exclusively or usually used as entity objects.

Example of an entity object type in Java: javax.swing.JButton

Externally immutable object

An object is externally immutable if its external visible state never changes after creation. The internal state may change, for example for a lazy initialization. Externally immutable objects must be thread safe.

Be aware that the state of objects that are part of an object O are part of the state of O.

Immutable object

An object is immutable if its visible state is immutable.

Part of an object

If an object P is part of another object O then

Type semantic

The semantic that a type is given. For example a type may have the semantic of a value object type.

Type misuse

If an object is used with a semantic that does not comply with the semantic of its defining type. For example an object that is used as a value but whose defining type is a mutable object type.

Example in Java: The class java.util.HashMap uses the value object semantic for its key values. But it allows objects of any type to be used as a key. That may cause errors if a key value is mutated after adding it to the HashMap.

Unique object or interned object

An object is unique (or interned) if there cannot be a second object that has an equal state. To compare the equality of unique objects it is sufficient to compare their identity.

Value object and value object type

A value object represents a value such as a floating point or a complex number. A value never changes in time. Instances of a value object type are externally immutable. A value may contain references to entity objects but an entity object cannot be a part of a value object.

A value object type is a type species that defines value objects.

Examples of value object types in Java: java.lang.Integer, java.lang.String.

   Author and Copyright 2014: Raoul Naujoks, Braunschweig, Germany      Version 9.9.2014