Is it the best practice to extract an interface for every class?

后端 未结 13 2526
我在风中等你
我在风中等你 2020-12-04 17:43

I have seen code where every class has an interface that it implements.

Sometimes there is no common interface for them all.

They are just there and they are

13条回答
  •  既然无缘
    2020-12-04 18:17

    Why do you need interfaces? Think practically and deeply. Interfaces are not really attached to classes, rather they are attached to services. The goal of interface is what you allow others to do with your code without serving them the code. So it relates to the service and its management.

    See ya

提交回复
热议问题