Why would you use Windsor AsFactory?
问题 Why would you use Castle Windsor factory auto implementation feature: AsFactory() rather then asking for needed interface? Example: container.Register(Component.For<IEmailSender>().ImplementedBy<SmtpEmailSender>()); container.Register(Component.For<IEmailSenderFactory>().AsFactory().LifeStyle.Transient); ... using (var factory = context.GetServiceFactory<IEmailSenderFactory>()) { var emailSender = factory.CreateEmailSender(); emailSender.Send(message); } Why wouldn't you simply write: var