Immutable Value

Abstract

Objects are often characterised by identity, behaviour and state. However, the relative importance between these can vary from problem to problem. Value patterns focus on those object patterns for which behaviour and state are more important than reference based identity, i.e. the ability to distinguish one object from another by its identity is not as significant as the role played by its content, leading to a distinction between a ValueObject and a ReferenceObject.

The ImmutableValue pattern resolves a number of implementation and optimisation issues found in concurrent systems and in languages whose object models rely exclusively on reference semantics. ImmutableValue can be considered one of the common JavaIdioms.

Context

Forces

Solution

Rationale

Resulting Context

Examples and Related Concepts

History

This pattern was first documented and presented in something like this form at the BCS OOPS Pattern Day, http://www.bcs-oops.org.uk/resources/BCSOOPSNL/Issue34Summer1998/Articles/Henney.html. It was then presented informally at PLoP 98, where it was workshopped and the form on this page is pretty much the result. -- KevlinHenney


EditText of this page (last edited October 30, 2004) or FindPage with title or text search