Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's IDEMPOTENT

 
Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Started reading HF JSP & Serlets. Stumpled over the word - IDEMPOTENT. I'm not sure I know the exact definition of this could someone help ?

Regards, Henrik (DK)
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An "idempotent" operation is one that can be repeated without side-effects. For example, an HTTP GET is supposed to be idempotent. You can fetch a web page as many times as you like without anything bad happening. HTTP POST, though, is not idempotent. POST is often used to submit forms. POSTing a form may, for example, place an order at Amazon.com. Repeating the POST may cause duplicate orders, so that is not an idempotent operation.

Make sense?
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, what Ernest said

Just don't forget that while a developer *can* make a non-idempotent GET, by creating code in the doGet() that, say, uses request parameters to update the server, the HTTP spec considers the HTTP GET method to be idempotent, no matter what. So as far as the exam is concerned, GET is idempotent (and POST is not), regardless of how you actually write your server-side code. So the spec is based on what you *should* do with these HTTP methods, not what you *actually* do.

cheers,
Kathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic