interface-segregation-principle

Interface Segregation Principle- Program to an interface

我的梦境 提交于 2019-11-26 15:47:23
问题 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 different principles? Is there a difference? 回答1: ISP is focused on the idea of each interface representing one discrete and cohesive behavior. That is, each logical group of things an object should do would map to a single specific interface. A class might want to do several things, but each thing would map to a specific interface