Interface Segregation Principle- Program to an interface

前端 未结 6 673
无人及你
无人及你 2020-12-01 01:05

I was reading about SOLID and other design principles. I thought ISP was the same as \"Program to an interface, not an implementation\". But it looks like these are differen

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 01:29

    Agree with both the answers above. Just to give an example of TrueWill's code smell above, you shouldn't find yourself doing this:

    @Override
    public void foo() {
        //Not used: just needed to implement interface
    }
    

提交回复
热议问题