Basic bean wiring(Chapter 2 of Spring In Action)
Spring provides four flavors of autowiring:
■ byName—Attempts to find a bean in the container whose name (or ID) is the same as the name of the property being wired. If a matching bean is not
found, the property will remain unwired.
■ byType—Attempts to find a single bean in the container whose type matches the type of the property being wired. If no matching bean is found,
the property will not be wired. If more than one bean matches, an org.springframework.beans.factory.UnsatisfiedDependencyException will be thrown.
■ constructor—Tries to match up one or more beans in the container with the parameters of one of the constructors of the bean being wired. In the
event of ambiguous beans or ambiguous constructors, an org.springframework.beans.factory.UnsatisfiedDependencyException will be thrown.
■ autodetect—Attempts to autowire by constructor first and then using byType. Ambiguity is handled the same way as with constructor and byType wiring.