By Yolande Poirier-Oracle on Jul 30, 2015
Choose the right Singleton pattern for your project. Learn about the different ways to implement the Singleton pattern, and how to use the pattern to create a database connection whose parameters can be updated after a Java application has been compiled.
Payene Denis Kombate explores the pros and cons of various ways to implement the Singleton pattern in his article titled Effective Ways to Implement and Use the Singleton Design Pattern. His comparison includes minimal, lazy-loading, synchronized, double-checked locking, volatile, and class holder singletons.
In addition, he shows an example of how to use the pattern to create a database connection and then how to update the database connection parameters after the Java application has been compiled. Read the article!