Approach 3: Dependency Injection

  • Use annotations to indicate that a class can be injected
  • Spring will pass you an instance of a class

27 / 27