It's unfortunately a little more complicated than that. Components are registered as they are declared in the binsor file. Some of those component may be used to satisfy an existing dependency as will thus be created immediately. When a subsequent extend occurs, it can't remove the component if it has already been bound. It will take some refactoring to make this happen.
On Wed, Feb 18, 2009 at 2: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 -~----------~----~----~----~------~----~------~--~---
