Skip to main content

Dirty Flag

BehavioralGame programmingPerformanceLess than 1 minute

Also known as

  • IsDirty pattern


To avoid expensive re-acquisition of resources. The resources retain their identity, are kept in some
fast-access storage, and are re-used to avoid having to acquire them again.

Class diagram

alt text
Dirty Flag


Use the Dirty Flag pattern when

  • Repetitious acquisition, initialization, and release of the same resource causes unnecessary performance overhead.