design-patternsstaleobjectstate

What is stale state?


I was reading about the object pool pattern on Wikipedia (http://en.wikipedia.org/wiki/Object_pool) and it mentions "dangerously stale state".

What exactly is "stale" state? I know state is variables/data, such as my fields and properties, but what does it mean by stale or dangerously stale?


Solution

  • Stale state is information in an object that does not reflect reality.

    Example: an object's members are filled with information from a database, but the underlying data in the database has changed since the object was filled.

    Dangerously stale state is stale state that might adversely affect the operation of a program, i.e. causing it to perform incorrectly due to invalid assumptions about the data's integrity.