Ambient container

Oct 3, 2008 at 10:17 AM
Edited Oct 3, 2008 at 10:21 AM
As well as .Current I think it makes for better coding semantics if the interfaces methods are "implemented" in the static class.
eg...

public static object GetInstance(Type serviceType)
{
    Current.GetInstance(Type serviceType);
}

As a result you can use
ServiceLocator.GetInstance(...)
instead of
ServiceLocator.Current.GetInstance(...)

The "Current" part always seems a little spurious.
Developer
Oct 4, 2008 at 6:55 PM
We were following the precendent set by the .NET framework - Thread.Current, HttpContext.Current, etc.