OSGi Service Locator
The Service Locator pattern is a well-established mechanism for accessing local and remote services in a consistent manner:
[java]
public interface ServiceLocator {
<T> T findService(String serviceName) throws ServiceNotAvailableException;
}
[/java]
Using a structured service name interface we can improve uniformity and reduce the potential for typos:
[java]
public enum ServiceName {
SomeService("SomeService");
...