cracking singleton with other ways

后端 未结 6 719
情深已故
情深已故 2020-12-07 05:20

I was doing research on singleton and I have developed a very basic singleton class..

public class SingletonObject {
    private static SingletonObject ref;
         


        
6条回答
  •  轮回少年
    2020-12-07 06:06

    My answer is:

    Why does it matter?

    If you are trying to design secure, uncrackable code then a Singleton is not a solution for that. It is designed to force the ordinary developer to use your system instance of it. All of these methods of getting around it require a lot of extra work that someone is not going to do simply to use a different instance of the class.

提交回复
热议问题