1. The Controller layer of spring still needs to write @Resource to inject the service layer object. Is this decoupling?
温故而知新,可以为师矣。 博客:www.ouyangke.com
Controller relies on Service for logic processing. It cannot be completely decoupled. It can only reduce the coupling between each other. If Spring is not used, calling Service to process business logic will be more complicated.
This is not about decoupling or not, but DI can reduce coupling.
Controller relies on Service for logic processing. It cannot be completely decoupled. It can only reduce the coupling between each other. If Spring is not used, calling Service to process business logic will be more complicated.
This is not about decoupling or not, but DI can reduce coupling.