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.
PHP中文网2017-05-17 10:04:21
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.