We are using the Windsor Typed Factory Facility in an attempt to resolve 
components by component name.

Here is our Factory interface

  public interface ILookupFormatterFactory
    {
        //Relies on windsor typed factory for implementation  

        ILookupFormatter Create(string componentId);

        void Release();
    }


Here is our registration code:
container.Register(
                Component.For<ILookupFormatter>()
                    
.ImplementedBy<DefaultLookupFormatter>().LifeStyle.Transient
                    .Named("DefaultLookupFormatter") 
                );

            container.Register(
               Component.For<ILookupFormatter>()
                  
 .ImplementedBy<RegexLookupFormatter>().LifeStyle.Transient
                   .Named("RegexLookupFormatter") 
               );

            container.Register(
                Component.For<ILookupFormatterFactory>().LifeStyle.Transient
                .AsFactory()
            );  


When we resolve by name (factory.Create("RegexLookupFormatter") the wrong 
component is returned (component with DefaultLookupFormatter is returned). 
  What are we doing wrong?


-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-users/-/MqTulYtQkZgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to