• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

is it cloning is possible in singleton pattern please explain

is it cloning is possible in singleton pattern please explain
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
  • 2
  • 2
1 Solution
 
ksivananthCommented:
it exploits the pattern, you shouldn't allow clone for singleton intended objects IMO
0
 
Sharon SethCommented:
You mean you want to clone the singleton object ? It is possible , but yo don't want to do it . If you clone , you no longer use a singleton
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
when i clone is it throw any error
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
is it throw any exception when i clone
0
 
ksivananthCommented:
the default implementation of clone method will throw CloneNotSupportedException, so unless you implement clone method of your singleton, its in good shape
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now