Abstracting IoC Container Behind a Singleton - Doing it wrong?

前端 未结 4 1580
日久生厌
日久生厌 2020-12-28 10:04

Generally, I like to keep an application completely ignorant of the IoC container. However I have ran into problems where I needed to access it. To abstract away the pain

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-28 10:18

    That's not really a singleton class. That's a static class with static members. And yes that seems a good approach.

    I think JP Boodhoo even has a name for this pattern. The Static Gateway pattern.

提交回复
热议问题