usage of structuremap

Jul 28, 2011 at 2:08 PM

 public class StructureMapDomainEventHandlerFactory : IDomainEventHandlerFactory
    {
        public IEnumerable<IDomainEventHandler<T>> GetDomainEventHandlersFor<T>
                                              (T domainEvent) where T : IDomainEvent
        {
            return ObjectFactory.GetAllInstances<IDomainEventHandler<T>>();
        }
    }

 

Apologize for trivial question however what is the point of using Structuremap within factory class. Could it be referenced directly within code? Why this encapsulation?

Here I tried to bring it to discussion. Thank you very much for your contribution. The book is superb.

http://stackoverflow.com/questions/6859008/using-autofac-in-factory-method