What's the difference between the Service Locator and the Factory Design pattern?

前端 未结 3 1145
执念已碎
执念已碎 2021-02-07 10:55

I\'m using unity and I\'m creating a class that wrapps it and I dont\' know how to call it, service locator or factory, both encapsulate the creation of the objects, so.... what

3条回答
  •  情书的邮戳
    2021-02-07 11:39

    Read this from Mark Seemann

    http://blog.ploeh.dk/2010/11/01/PatternRecognitionAbstractFactoryOrServiceLocator.aspx http://blog.ploeh.dk/2010/02/03/ServiceLocatorIsAnAntiPattern.aspx

    It's good for the begining

提交回复
热议问题