This post is based on early source code of Enterprise Library 5 and is subject to change when Enterprise Library 5 is RTM.
Enterprise Library 5 has a new class, called EnterpriseLibraryContainer, which is a single, convenient access point to the Enterprise Library objects being used in your .NET application. EnterpriseLibraryContainer is nothing more than a facade class around IServiceLocator and your chosen IoC Container. By default, Enterprise Library will of course use Unity as its IoC of choice.
Before EnterpriseLibraryContainer and IServiceLocator
In Enterprise Library 4.1 one added the EnterpriseLibraryCoreExtension and other application block specific extensions to a Unity Container you created to populate the container with Enterprise Library objects and services.
IUnityContainer container = new UnityContainer(); container.AddNewExtension<EnterpriseLibraryCoreExtension>(); container.AddNewExtension<DataAccessBlockExtension>(); Database db = container.Resolve<Database>();
EnterpriseLibraryContainer in Enterprise Library 5
For your convenience, you now don’t have to create your own IoC container and populate the container with various Enterprise Library and Application Block extensions in Enteprise Library 5. Instead, you can now just access the EnterpriseLibraryContainer.Current Property and access your objects via it. The Current Property exposes IServiceLocator, which is a general interface supported by many IoC Containers, like Castle Windsor, Autofac, Ninject, Spring, StructureMap, etc.
var db = EnterpriseLibraryContainer.Current.GetInstance<Database>();
var contacts = db.ExecuteSprocAccessor<Contact>("FetchAllContacts");
Conclusion
Some nice changes appearing early on in Enterprise Library 5 to help make it easier to use in your applications. When Enterprise Library 5 gets a bit more stable I will create some Enterprise Library 5 Screencasts on PnPGuidance.
Hope this helps.

Comments