Separation of Identity and State

Quick, what’s the price of Google stock? We may argue that the value of the stock changes by the minute when the market is open, but that’s in some way just playing with words. To take a simple example, the closing price of Google stock on December 10, 2010, was $592.21, and that’ll never change—it’s immutable and written in history. We’re looking at a snapshot of its value at a said time. Sure, the price of Google stock today is different from the one on that day. If we check back a few minutes later (assuming the market is open), we’re looking at a different value, but the older values don’t change. We can change the way we view objects, and that changes the way we use them. Separate identity from its immutable ...

Get Programming Concurrency on the JVM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.