Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
4 user(s) are online (3 user(s) are browsing encyclopedia)

Members: 0
Guests: 4

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Idempotent (software)

In Computing, idempotence is the quality of something that has the same effect if used multiple times as it does if used only once, similarly to the idempotence notion in mathematics.

= Idempotent header files =

C programming language header files are often designed to be idempotent, that is, if the header file is included more than once (as can easily happen with nested #included files), then nothing untoward happens - the effect is the same as if a file had been included only once.

A standard trick is to surround the whole text of the includable file by #ifndef/#endif directives:

/* File: sample_header.h */ #ifndef UNIQUE_PREPROCESSOR_CONSTANT #define UNIQUE_PREPROCESSOR_CONSTANT /* Here goes the material content of the file */ #endif

= WWW behavior =

HTTP GET requests are supposed to be be idempotent. The World Wide Web infrastructure makes this assumption and often caching the result of these requests.

Incorrect programming of a web site may sometimes lead to undesired behavior. In some cases, usually an incorrect or missing timestamp, the software cannot correctly detect that the content of the requested page has been changed since the last request. If there is a suspicion of this happening, the local cache may need to be cleared.

HTTP POST requests (usually used for user input forms) are not meant to be idempotent, so the result of a POST request is not cached.

= User interface =

In user interface design, a button is 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 , a different button, 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 some people think they are not.