How does PicoContainer decide what constructor to use?
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
- How does the PureMessage software decide what messages to send to the Quarantine site and which messages to send to my Inbox?
- What is the difference between TRADITIONAL and CONTEMPORARY responses? How do I decide which is best for our organization?
- How does PicoContainer decide what constructor to use?