Archive for May 12, 2006

Idempotent methods

Have you ever noticed a method in your project or programs which act and respond the same way whether you call it once or n number of times irrespective of the situation or variation in inputs? Meet the idempotent methods. Idempotent methods are not different from any other methods in terms of how they look and feel or syntactically constructed. But how idempotent is different from any other method is in the way it behaves during the run time. Idempotent methods are monotonous methods in essence even if you call them any number of times it still responds back as if it was called once. Probably you are unaware that the HTTP GET, PUT, DELETE and HEAD methods are idempotent methods. For example the GET method of a particular page request would always bring back the same content how many ever times you call it under any different situation. Hence web server implementations assume this and cache the GET requests. That is yet another reason that you should use the POST method for the web requests. You can read more about it with a good example here in Wikipedia. Ironically idempotent methods are free of side effects. Idempotence is also a mathematical concept. Again more about this, here in Wikipedia.

Blink this Idempotent methods at blinklist.com    Bookmark Idempotent methods at blogmarks    Bookmark Idempotent methods at del.icio.us    Digg Idempotent methods at Digg.com    Fark Idempotent methods at Fark.com    Bookmark Idempotent methods at Furl.net    Bookmark Idempotent methods at NewsVine    Bookmark Idempotent methods at reddit.com    Bookmark Idempotent methods at Simpy.com    Bookmark Idempotent methods at Spurl.net    Bookmark Idempotent methods with wists    Bookmark Idempotent methods at YahooMyWeb

Comments      Cosmos


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.