- It's a design pattern for simplifying dependency injection
- The ServiceLocator class would be a singleton class whose object contains a dictionary of all dependencies in the project
- the main point of using ServiceLoc
ator is to make the dependenci es easily replaceabl e at runtime - It can be used along with other IoC containers - IoC containers are good to initialize dependencies whereas service locator can help replacing the dependencies at runtime after initialization when needed
The problem with this is that if there is any ref-type property, this doesn't work. Which means every ref-type property must implement its own Equals.
No comments:
Post a Comment