O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required