Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does PicoContainer decide what constructor to use?

0
10 Posted

How does PicoContainer decide what constructor to use?

0
10

PicoContainer will instantiate a given component using the “greediest” satisfiable constructor. By greedy, we mean the constructor that takes the most parameters. By satisfiable, we mean constructors where all arguments can be satisfied by other registered components. If you register a component with no satisfiable constructors, or two or more ambiguous “largest” constructors, a RuntimeException will be thrown when you ask for the component instance. We recommend, for the sake of predictablility, that PicoContainer compatible components use only one constructor, although this is by no means a requirement.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123