The idempotent of program function design

Source: Internet
Author: User

1. idempotent

One of the characteristics of a idempotent operation is that its arbitrary multiple executions have the same effect as one execution. Idempotent operations are "friendly" to proxies and caches, because additional execution of idempotent operations does not have a detrimental effect on both (except bandwidth waste).

In other words, an operation is idempotent, which means that the operation executes once and executes multiple times on the internal state of the system. But we initialized the person object ' Old king ' and then executed the old king. Setage (56) Set the age of the old king, regardless of the old king. Setage (56) executes several times, the effect on the inner state of the object is the same as the old king, so the Setage () method of the person is idempotent.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.