Added Service Locator pattern

I have added the example code for the Service Locator pattern.