Singleton rule questions (do not allow to create copy and deserialization)
Posted
by Petr
on Stack Overflow
See other posts from Stack Overflow
or by Petr
Published on 2010-04-28T13:17:23Z
Indexed on
2010/04/28
13:23 UTC
Read the original article
Hit count: 128
Hi, Reading some article about singleton, I stopped at the point saying: "Do not allow to crate copy of existing instance". I realized that I do not know how would I do that! Could you tell me, please, how could I copy existing instance of class? And the second one: deserializaition. How it could be dangerous?
And for both - how to deny creating copies or deserialization? Thanks
© Stack Overflow or respective owner