Dependency Injected Singletons… What?

Background Previously I wrote a bit about singletons. I'm not afraid to say that I think singletons have a time and a place... Okay, I'm afraid to say it, but it's actually how I feel :) After learning more and more about inversion of control design patterns and programming by interfaces, I started to notice just how inflexible singletons are. When you consider using a singleton, you should be considering both the pros and cons without jumping right into it. Here's an example of my approach for mixing singletons, programming by interfaces, and a bit of inversion of control. The Setup I'm actually surprised you got this far. I'm sure you're probably just sticking around to see how messed up this could possibly be. I'm actually proud that this little pattern has worked out so well when I've used it,…


End of content

No more pages to load