I use castle windsor a lot in a project i'm working on and use decorators a little so I might have something like this in my installer
Component.For<IMyViewModelService>().ImplementedBy<MyViewModelServiceCacheDecorator>().LifestyleTransient()
Component.For<IMyViewModelService>().ImplementedBy<MyViewModelService>().LifestyleTransient()
So doing this is easy enough and works well. I started reading around the simple injector framework and I really like they way you can specifically set the decorators on open generics when using the command pattern.
https://simpleinjector.readthedocs.org/en/latest/advanced.html#decorators
Does castle windsor have any functionality that allows you to do the same thing in this declarative manner? I'm using castle windsor 3.3 and always stay with the latest.
I see this question which is kind of similar but doesn't have a full outcome registering open generic decorators for typed implementations in castle windsor
Perhaps I'm not understanding what you're trying to do, but Castle supports open generic decorators just fine. Given these objects:
And this registration and resolution:
Then resolving the service and calling
Info
:Will print:
If this is not what you're trying to do, please update your question with a more precise example.