3 The Spring context: Wiring beans

This chapter covers

  • Establishing relationships among beans
  • Using dependency injection
  • Accessing the beans from the Spring context through dependency injection

In chapter 2, we discussed the Spring context: the place in the app’s memory where we add the object instances we want Spring to manage. Because Spring uses the IoC principle, as we discussed in chapter 1, we need to tell Spring which objects of our app it needs to control. Spring needs control over some of the objects of our app to augment them with the capabilities it provides. In chapter 2, you learned multiple ways to add object instances to the Spring context. You also learned that we add these instances (beans) into the Spring context to make ...

Get Spring Start Here now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.