The significance of creating interfaces for the Service layer and Dao layer in the Spring Web project

For web projects, the Service layer and Dao layer are maintained with interfaces. I believe many people will think so: I have been working on projects for several years, and I have never found a second implementation class for the Service or Dao interface in the business code. To write a method, you need to declare it once in the interface and implement it again, which is very troublesome. It is better to implement it directly.

 

Practical meaning:

The advantages of the interface should be understood by everyone: only care about the invocation of the interface, not the internal implementation; in team development, synchronous development can be better achieved. As long as the provider and the user define the interface in the early stage, the front-end and back-end can be developed synchronously, instead of waiting for the back-end to be developed before the front-end can be developed;

 

https://www.oschina.net/question/935784_247005?sort=default&p=2

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326297166&siteId=291194637