Distinguish between multiple component bindings

3 views
Skip to first unread message

Merijn de Jonge

unread,
Mar 22, 2012, 6:21:14 PM3/22/12
to Castle Project Users
My program uses an interface IA that is implemented by a class A. This
class has a dependency on an interface IB which is implemented by a
class B. Class B has a dependency on interface IC and for this
interface there are multiple implementations (say C1 and C2). My
question is: is it possible to register and resolve two bindings for
interface IA, the first resolves into IA-A-IB-B-IC-C1 and the second
in IA-A-TB-B-IC-C2? So, I get two implementations for IA, which only
differ in the implementation of some indirect dependency.

Thanks in advance.
Merijn


Patrick Steele

unread,
Mar 22, 2012, 6:24:25 PM3/22/12
to castle-pro...@googlegroups.com
I think service overrides would do what you want. See:

http://docs.castleproject.org/Windsor.Registering-components-one-by-one.ashx#Supplying_the_component_for_a_dependency_to_use_Service_override_9

---
Patrick Steele
http://weblogs.asp.net/psteele

> --
> You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
> To post to this group, send email to castle-pro...@googlegroups.com.
> To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
>

Merijn de Jonge

unread,
Mar 23, 2012, 12:02:05 PM3/23/12
to Castle Project Users
Thanks, that helped!


On Mar 22, 11:24 pm, Patrick Steele <patrick.ste...@gmail.com> wrote:
> I think service overrides would do what you want.  See:
>
> http://docs.castleproject.org/Windsor.Registering-components-one-by-o...
>
> ---
> Patrick Steelehttp://weblogs.asp.net/psteele
Reply all
Reply to author
Forward
0 new messages