http://c2.com/cgi/wiki?SingletonsAreEvil

Almost every use of singleton I have encountered was best replaced by an attribute accessor in a higher level object that is then either

  • explicitly passed around via a parameter, or
  • used via a dynamically bound variable (possibly within a thread-safe wrapper)

相关文章:

  • 2021-04-30
  • 2021-04-16
  • 2021-06-24
  • 2022-01-16
  • 2021-09-01
  • 2021-07-01
  • 2021-09-27
  • 2021-07-08
猜你喜欢
  • 2021-09-07
  • 2022-02-06
  • 2021-12-25
  • 2021-07-02
  • 2021-05-18
  • 2021-06-21
  • 2021-10-20
  • 2021-06-14
相关资源
相似解决方案