This should indeed work, but I am using the key to resolve components in this scenario (ASP.NET MVC ControllerFactory) I came up with another solution. If I want to replace a certain controller by another one for a specific tenant I remove the controller I want to replace from the container in my Binsor and I add the new controller. I think I can safely remove it because the controller will never be used to fulfill dependencies.
On Fri, Feb 20, 2009 at 6:06 PM, João Bragança <[email protected]>wrote: > > I think you can use component forwarding for this: > > component "one", IInterface, Implementation1 > component "two", IInterface, Implementation2 > > extend "two" < IInterface > > all calls to Resolve<IInterface>() should be redirected to "two" > > On Feb 20, 8:24 am, Bart Reyserhove <[email protected]> wrote: > > You can redirect future calls from the previous component to the new one, > > though > > I cannot seem to find any information on this. Is there documentation on > > Windsor available that describes this? > > > > On Wed, Feb 18, 2009 at 10:17 PM, Ayende Rahien <[email protected]> > wrote: > > > No, you can't.Not only that, but you can't rely on the ability to > remove a > > > component from the container. > > > You can redirect future calls from the previous component to the new > one, > > > though. > > > > > On Wed, Feb 18, 2009 at 3:54 PM, Bart Reyserhove < > > > [email protected]> wrote: > > > > >> I want to completely replace a component. I did not think it was > possible > > >> with extend > > > > >> On Wed, Feb 18, 2009 at 9:52 PM, Ayende Rahien <[email protected]> > wrote: > > > > >>> Not following... > > > > >>> On Wed, Feb 18, 2009 at 3:51 PM, Craig Neuwirt <[email protected] > >wrote: > > > > >>>> extend only extends dependencies and interface forwaring.. > > > > >>>> On Wed, Feb 18, 2009 at 2:49 PM, Ayende Rahien <[email protected] > >wrote: > > > > >>>>> Why can't you use extend? > > >>>>> That is why it is here > > > > >>>>> On Wed, Feb 18, 2009 at 3:23 PM, Bart Reyserhove < > > >>>>> [email protected]> wrote: > > > > >>>>>> I noticed this week you could extend existing components but can > you > > >>>>>> also override them? > > >>>>>> I mean by override something in the following style: > > > > >>>>>> for type in AllTypesBased of IController("WineCellar.Web"): > > >>>>>> component type.Name.ToLower(), type: > > >>>>>> lifestyle Transient > > >>>>>> interceptor LoggingInterceptor > > > > >>>>>> Component "winecontroller",WineController of > > >>>>>> ParkerWine,ParkerWineController: > > >>>>>> lifestyle Transient > > > > >>>>>> You have probably guessed already. The component with key > > >>>>>> "winecontroller" is already registered in a statement that just > registers > > >>>>>> all controllers. I don't want to register all my controllers > manually, but > > >>>>>> then again I want to overwrite one of the controllers for a > specific tenant. > > > > >>>>>> I think there are different possibilities to do this: > > > > >>>>>> 1. This would be easy enough to do by just checking in > "Component" > > >>>>>> whether the component was already registered and if that is the > case, remove > > >>>>>> it again and register the second one. Now this throws an > exception. > > >>>>>> 2. Add a new overload for Component > > >>>>>> 3. Add "Override" in a similar way as "Extend" > > > > >>>>>> What do you think? > > > > >>>>>> Bart > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. 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/rhino-tools-dev?hl=en -~----------~----~----~----~------~----~------~--~---
