Jump to content
  • entries
    437
  • comments
    1000
  • views
    337160

Nasty Singletons

Sign in to follow this  
evolutional

103 views

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.
Sign in to follow this  


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!