Skip to content

Bookmarked https://torquemag.io/2016/11/singletons-wordpress-good-evil/. “Singletons are useful, but they …

Bookmarked https://torquemag.io/2016/11/singletons-wordpress-good-evil/.

Singletons are useful, but they reduce flexibility and therefore should be used sparingly. EDD is a great example. There is one main singleton that houses all the other “main” instances, of the other classes, without having to use a singleton on every one of those other classes.

Singletons In WordPress: Good Or Evil? | @thetorquemag
torquemag.io

Replies

  1. Jan Boddez Jan Boddez on

    That looks like a somewhat appropriate trade-off between being able to still retrieve a (single) class instance (like, for removing callbacks from hooks) and testability.

    Via geekcompass.com, in reply to Bookmarked https://torquemag.io/2016/11/singletons-wordpress-good-evil/. “Singletons are useful, but they ….