Definition

The separation of mechanism and policy is a design principle in computer science. According to the separation of mechanism and policy principle, mechanism should work no matter what policy is used.

  • Mechanism is a part of a system implementation that control the authorisation of operations and the allocation of resources.
  • Policy determines which decisions are made about which operations to authorise, and which resources to allocate.

For example, when considering a thread context switch, mechanism decides how to switch between threads, and policy determines which thread to run next.