methods are written in such a way that repeated
calls to the same method do not cause duplicate
updates, the method is said to be "idempotent."
mathematics an idempotent element, or an idempotent
for short, is anything that, when multiplied
by itself, gives itself as result. For example,
the only two real numbers which are idempotent
are 0 and 1.
user interface design, a button can be called
"idempotent" if pressing it more than
once will have the same effect as pressing it
once. For example, a "Pause" button
is not idempotent if it toggles the paused state.
On the other hand, if pressing it multiple times
keeps the system paused and pressing "Play"
resumes, then "Pause" is idempotent.
This is useful in interfaces such as infrared
remote controls and touch screens where the
user may not be sure of having pressed the button
successfully and may press it again. Elevator
call buttons are also idempotent, though many
people think they are not.