Immutability An object is immutable if outside entities cannot change its internal properties.

Facts, Thoughts and Opinions

Virtues of Immutable Objects

  • Immutable objects are simpler to construct, test, and use.
  • Truly immutable objects are always thread-safe.
  • Immutable objects help avoid temporal coupling.
  • The usage of immutable objects is free of side effects (no defensive copies).
  • Immutable objects always have failure atomicity.
  • Immutable objects are much easier to cache.
  • Immutable objects prevent NULL references.


  •   Subtopics

  •   Writings

  Sources & Bookmarks

Name/Link Date