Nasty Singletons
I stumbled across a 'debate' on Singleton Managers which sparked my interest.
After reading Enginuity I was a huge fan of the Singleton 'pattern' as it allowed me to circumvent the whole notion of OOP and access my data from everywhere. Unsuprisingly, I used it everywhere and in every way I possibly could because I thought it was 'neat'. It started out with my logger and eventually crept into every class I had that had any kind of management responsibility. Before I knew it everything was accessing everything else and my seemingly simple systems were so tied into one another that even a minor change would take hours to implement. It was, quite simply, a nightmare.
I'm not going to join this whole debate as I believe there's a time and a place for everything, but please please please, if you're going to use a Singleton then at least know WHY you're going to use it and be aware of the issues that you could create for yourself by misdesigning the system.
After reading Enginuity I was a huge fan of the Singleton 'pattern' as it allowed me to circumvent the whole notion of OOP and access my data from everywhere. Unsuprisingly, I used it everywhere and in every way I possibly could because I thought it was 'neat'. It started out with my logger and eventually crept into every class I had that had any kind of management responsibility. Before I knew it everything was accessing everything else and my seemingly simple systems were so tied into one another that even a minor change would take hours to implement. It was, quite simply, a nightmare.
I'm not going to join this whole debate as I believe there's a time and a place for everything, but please please please, if you're going to use a Singleton then at least know WHY you're going to use it and be aware of the issues that you could create for yourself by misdesigning the system.
0
Sign in to follow this
Followers
0
3 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now