Why we used the Singleton pattern

For the library, there was much debate on the use of the Singleton pattern. There are very few use cases for it, and we tried really hard to move forward without it. However, when it came down to building an abstract widget class that extended the WP_Widget class, our hand was forced. At that point, the class has no connection to the library class. There was no way to pass an instance of the library class into the widget class and so there were only 2 ways to access the library class from the widget class:

1. Create a global variable and access it from within the class.

2. Setup the library as a singleton and access it as a local variable that points to the instance of the library class.

We chose option number 2. We did this because the Woocommerce plugin apparently found value in moving away from globals and to the singleton patterns, AND because this article set our mind at ease: http://eamann.com/tech/the-case-for-singletons/.