HackerTrans
トップ新着トレンドコメント過去質問紹介求人

maname

no profile record

コメント

maname
·2 年前·議論
thanks, that clicks.

"Simply put, we can perform an idempotent operation multiple times without changing the result.

Furthermore, the operation must not cause any side effects after the first successful execution."

Baeldung got it right.
maname
·2 年前·議論
IMO these statements contradict themselves:

> Idempotency refers to the ability of an operation to be performed multiple times whilst still yielding the same outcome

and

> The issue with the above code is that if the event is processed twice the EmailService will send a duplicate email.

In other words, the operation (three lines of code) yields the same result (sending an email) after repeated execution, and thus is idempotent isnt it? Or is the point that idempotency is harmful in this case?