Things That Matter Most

Things That Matter Most

  • Home
  • Business
  • Faith
  • Technology
  • Politics
  • Creative Writing
  • Email
  • GitHub
  • RSS
  • Twitter

Powered by Genesis

Making Singletons Safe in PHP

January 7, 2013 by Eric

Last time, I argued in favor of the Singleton pattern in WordPress.  Singletons make sense in WordPress specifically for several reasons: They live in the global scope without using the already abused/overused global keyword As a distributed application maintained by several hundred developers, they prevent problems that likely arise from others misusing your code But […]

Filed Under: Technology Tagged With: Class, Dependency Injection, Duck Typing, Global Variable, Method, Object-oriented Programming, PHP, singleton, Singleton Pattern, Software Design Patterns, Unit Test, WordPress, Y Combinator

The Case for Singletons in WordPress

December 28, 2012 by Eric

Please also review my follow-up post, Making Singletons Safe in PHP. There has been a lot of discussion this week regarding the Singleton pattern and whether or not it has a place in modern software development.  Mike Schinkel wrote a tutorial about a Singleton factory.  I wrote one about using Singletons as a WordPress plugin […]

Filed Under: Technology Tagged With: Computer Programming, Dependency, Dependency Injection, design pattern, Developer, Object, singleton, Singleton Pattern, software, WordPress, You're

About Me

Eric is a storyteller, web developer, and outdoorsman living in the Pacific Northwest. If he's not working with new tech in web development, you can probably find him out running, climbing, or hiking in the woods.

Get the newsletter