Spring provides these two ways to define the DI pattern to inject the dependency with the dependent bean in an application: