Immutable Object

In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created. In some cases, an object is considered immutable even if some internally used attributes change but the object's state appears to be unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object.

Immutable objects are often useful because they are inherently thread-safe. Other benefits are that they are simpler to understand and reason about and offer higher security than mutable objects.

Read more about Immutable Object:  Background, Implementation, Copy-on-write, Usage

Famous quotes containing the words immutable and/or object:

    I don’t know what immutable differences exist between men and women apart from differences in their genitals; perhaps there are some other unchangeable differences; probably there are a number of irrelevant differences. But it is clear that until social expectations for men and women are equal, until we provide equal respect for both men and women, our answers to this question will simply reflect our prejudices.
    Naomi Weisstein (b. 1939)

    I consider, then, the power to annul a law of the United States, assumed by one state, incompatible with the existence of the Union, contradicted expressly by the letter of the Constitution, unauthorized by its spirit, inconsistent with every principle on which it was founded, and destructive of the great object for which it was formed.
    Andrew Jackson (1767–1845)