7 responses

  1. Steven
    February 14, 2013

    hi

    Volatile keyword is for field only, it is not a legal modifier for the method.

    public static volatile SingletonExample getSingletonInstance() {} this line is wrong.

    • IdioTechie
      February 18, 2013

      Corrected. It was a typo. Thanks Steven for highlighting this.

  2. Joseph
    March 21, 2013

    Great explanation with good examples…! Example with Factory Pattern is ultmate…!
    Thanks.

  3. shiva satyanarayan
    April 12, 2013

    Very good article. Well explained. This will work where we are using a single classloader like the jvm boot / app classloader to load the class. It would be good to understand and provide a solution to situations like module level classloading that happens in web / enterprise applications (war / ear class loading). How to truly make it singleton in these conditions.

    • IdioTechie
      April 13, 2013

      Thanks Shiva. I will try to provide an article for the module level class loading.
      Please keep providing your valuable feedback.

  4. Raman
    February 19, 2014

    Great work.. Helped me to understand the singleton pattern easily. Thanks for th efforts.. Do you have similar discussion for other patters with merits demerits and FAQ. Also do you have anything for JBoss and Webservice? Keep going with such work and thanks once again

    • IdioTechie
      February 20, 2014

      Many thanks Raman. Please do keep visiting this website. I do have some other design patterns in my website. I will try to come up with articles on JBoss and webservices.

Leave a Reply

 

 

 

Back to top
mobile desktop