你的位置: 码友网首页 / 资讯源列表 / The Interface Segregation Principle Applied in .NET

关于[The Interface Segregation Principle Applied in .NET]的摘要:

Scott HannenAbout The Interface Segregation Principle Applied in .NET Jan 1, 2019 The common definition of the Interface Segregation Principle (ISP) is: No client should be forced to depend on methods it does not use. This predates the .NET Framework, so how can we apply it to .NET code? The “client” is a class that depends on another class or interface. The word “interface” doesn’t refer specifically to the interface keyword. A class could depend on the public members of another class. But we often write our “client” classes to depend on interfaces defined with the interface keyword. So, while this post (and many others) apply the principle to interfaces declared with the interface keyword, the principle is not limited to that.

原文地址: http://scotthannen.org/blog/2019/01/01/interface-segregation-principle-applied.html

收录时间: 2019-01-03 浏览量: 1515 分类: 架构设计

| 0 收藏 | 0