Dependency injection types

In the previous example, we used a setter method to wire in the dependency. There are two types of dependency injections that are used frequently:

  • The setter injection
  • The constructor injection

Get Mastering Spring 5.0 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.