资 源 简 介
This simple implementation of the service locator pattern has been used extensively in a number of large-scale commercial projects for over three years now. The only public domain project it is used in is the Turn Engine project.
What does this API give you?
Tiny - only a handful of classes.
Simple - access dependencies at any place in your code, no need to pass them around in constructors, setters or even as fields.
Singletons - virtually eliminates the need to write singletons
Tutorial
Downloads
Service Locator Pattern - Why Use It?
For an overview of the general Service Locator pattern, refer Martin Fowler"s article on inversion of control provides a good summary