Summary

In this chapter, you learned about Inversion of Control (IoC) and dependency injection. Inversion of Control, a concept based on Java language constructs, allows us to define object dependencies in terms of interfaces or abstract classes, and lets an outside object, the IoC container, instantiate them from concrete classes.

We saw how the Spring IoC container can be used to develop IoC-style code. First, you must define all object dependencies of interfaces or abstract classes. Then, you must configure bean definitions to tell the container which dependency of which concrete class should be instantiated. Finally, you must start up the IoC container and obtain configured objects by their names.

In Spring, bean definitions can be in XML or ...

Get Spring Persistence with Hibernate now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.