The unity container goes beyond simply configuring and creating enterprise library objects. One way Unity can create objects for you automatically is by simply declaring the objects you need in your constructors.
public class Foo
{
IExceptionManager _em;
IDatabase _db;
IServiceAgent _sa; // custom made service agent for accessing some other web service
public Foo(IExceptionManager em, IDatabase db, IServiceAgent _sa)
{
_em = em;
_db = db;
_sa = sa;
}
}
_em, _db _sa Unity. , . Unity - , , , .. ( )
, Unity, EntLib Unity. Unity , , , - .