c# - Is a singleton constructor idempotent? -


i'm still trying grasp both concepts, if i'm misunderstanding kindly explain.

i've read few sources on idempotent operations (namely so entry) , yesterday senior dev @ workplace sent article around singleton's. while reading singleton article wondering, constructor object implements singleton pattern idempotent?

my understanding because calling singleton.instance() (v. 6 singleton article) more 1 time not change because singleton cannot instantiated more once, i'm not entirely sure if i'm combining 2 topics correctly.

when operation described idempotent means calls made same parameters should result in no additional state change. example, in rest api delete request idempotent means if make subsequent requests delete resource , it's gone still success back. users point of view appears has happened, system isn't changing it's acknowledging request i.e.

user: "please delete resource a"  system: "check status of resource a"  system: "resource found, deleting resource a" || "resource not found"  system: "return ok" 

so taking concept of singleton works pretty same. make subsequent requests create object, however, operation performed once - rest returned created instance.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -