Singletonitis

My colleagues say that I am infected from “Singletonitis”. It is an addiction to Singleton pattern. :) Singleton pattern allows only a single instance of a class with a global access. Now my addiction is not on its over use in code, but because of lot of preaching to my team mates about singletons…

It may not always be necessary to have singletons if the class in question has insignificant memory, rather stick passing the object as the reference (argument) to the functions in such cases. Prefer singletons in places where the object memory size is significant.

Subscribe / Share

Nitin tagged this post with: Design Patterns Read 181 articles by

Liked By

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other subscribers

Monthly Archive

Photos From Reflections

Performance Optimization WordPress Plugins by W3 EDGE