State - Immutable

> (Data|State) Management and Processing

1 - About

A state who is immutable cannot be changed.

An variable (object) is considered immutable if its state cannot change after it is constructed.

Immutable objects are particularly useful in concurrent applications. Since they cannot change state, they cannot be:

Advertising

3 - Rules

  • Don't provide "setter" methods — methods that modify fields or objects referred to by fields.
  • Make all fields final and private (ie have a local scope)

4 - Documentation / Reference

data/immutable.txt · Last modified: 2019/02/13 10:15 by gerardnico