Picks greediest it can satisfy. If you don't want IBar in Application A don't register it there On Jul 26, 2012 7:19 AM, "Scott_M" <[email protected] (mailto:[email protected])> wrote: > How does Windsor deal with multiple constructors? How can it determine which > one to call? In my case Application A may not need IBar but Application B > may need it. > > > thanks > > > > > On Wednesday, July 25, 2012 4:14:17 PM UTC-5, Krzysztof Koźmic wrote: > > Create another constructor with just foo > > On Jul 26, 2012 7:12 AM, "Scott_M" <[email protected] > > (mailto:[email protected])> wrote: > > > Ran into a recent case where one of my new apps is using a component > > > where a constructor based dependency of that component is not necessary > > > (IBar) and would be painful to inject (lot of projects/related projects > > > to import/build). Here is a simplified example: > > > > > > public MyService : IService > > > { > > > private IFoo _foo; > > > private IBar _bar; > > > > > > public MyService(IFoo foo, IBar bar) > > > { > > > _foo = foo; > > > _bar = bar; > > > } > > > } > > > > > > So lets say that the IBar dependency is not needed for the current > > > application but IFoo is. Is there a good way to inject NULL for that > > > dependency using windsor config / XML / Nullable<T>? How is this done? > > > > > > > > > > > > thanks > > > > > > > > > > > > > > > -- > > > 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/-/i7nkYXi8mp0J. > > > To post to this group, send email to > > > [email protected] > > > (mailto:[email protected]). > > > To unsubscribe from this group, send email to > > > [email protected] > > > (mailto:castle-project-users%[email protected]). > > > For more options, visit this group at > > > http://groups.google.com/group/castle-project-users?hl=en. > -- > 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/-/rmlDXRvKOWsJ. > To post to this group, send email to [email protected] > (mailto:[email protected]). > To unsubscribe from this group, send email to > [email protected] > (mailto:castle-project-users%[email protected]). > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en.
-- You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en.
