Previous chapters explored how to encapsulate indirect input and output into classes providing those services and elaborated on the usefulness of test doubles capable of simulating those services during a unit test. This chapter introduces the service locator as a way to manage those services.
Purpose of a Service Locator
A service locator is a design feature implemented into a program for the purpose of providing a central registry for the various entities providing services to the program. It can be thought ...