java - For example, when writing a Service or Dao in Spring MVC, is it best to write an interface implementation?
習慣沉默
習慣沉默 2017-05-17 10:02:21
0
1
487

I see many examples of writing a UserService, and then writing an interface implementation such as UserServiceI. I feel that it is very troublesome to write so many duplicate files for small projects.

習慣沉默
習慣沉默

reply all(1)
Ty80

If it is for self-entertainment, such as a small project that is only used in one place, there is no need to write an interface. Unless it is used in multiple places or called remotely. Interfaces are used to abstract implementations and are not necessary for all scenarios.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!