caloggins
4/9/2012 - 1:40 PM

Abstract factory w/ Windsor backing

Abstract factory w/ Windsor backing

    public interface IAbstractFactory<in TY>
    {
        T Create<T>() where T : TY;
    }

    public class AbstractFactory<TY> : IAbstractFactory<TY>
    {
        private readonly IWindsorContainer container;

        public AbstractFactory(IWindsorContainer container)
        {
            this.container = container;
        }

        public T Create<T>()
            where T : TY
        {
            return container.Resolve<T>();
        }
    }