Why interface

“the key benefit of DI is loose coupling. If an object only knows about its dependencies by their interface then the dependency can be swapped out with a different implementation without the depending object knowing the difference” Spring in action

你可能感兴趣的:(spring)