By bloid
via www-128.ibm.com
Published: Feb 22 2007 / 05:37
Immutable objects are a great help for writing thread-safe software. In the Java™ language, the primary mechanism for guaranteeing immutability is the use of final fields. This article shows an efficient way to implement a slightly more relaxed model of immutability, using normal cached fields whose values can still be accessed safely without synchronization.
Add your comment