> There are many tasks that must be done when the thing switches states.

Such as?