Skip to main content
Dirty Flag

Also known as

  • Change Tracking
  • Is-Modified Flag

Intent

The Dirty Flag design pattern is employed to avoid unnecessary computations or resource-heavy operations by maintaining a boolean flag that tracks whether the state of an object has changed ('dirty') or remains unchanged ('clean'). This flag, when set, indicates that a particular operation, such as recalculating or refreshing data, needs to be performed again to reflect the updated state.


iluwatarAbout 3 minBehavioralGame programmingPerformanceResource managementState tracking
Server Session

Also known as

Server-side session state pattern

Intent

Within the context of a client-server relationship, the server is responsible for storing session data in order to maintain state in an otherwise stateless environment.

Explanation

Real-world example


iluwatarAbout 4 minBehavioralCookiesSession managementState tracking