对开发人员有用的定律、理论、原则和模式

43课时
411学过
10分

阿姆达尔定律 (Amdahl's Law)

破窗效应 (The Broken Windows Theory)

布鲁克斯法则 (Brooks's Law)

康威定律 (Conway's Law)

坎宁汉姆定律 (Cunningham's Law)

邓巴数字 (Dunbar's Number)

盖尔定律 (Gall's Law)

古德哈特定律 (Goodhart's Law)

汉隆的剃刀 (Hanlon's Razor)

侯世达定律 (Hofstadter's Law)

哈伯特定律 (Hutber's Law)

技术成熟度曲线 (The Hype Cycle or Amara's Law)

隐式接口定律 (Hyrum's Law or The Law of Implicit Interfaces)

柯林汉定律 (Kernighan's Law)

梅特卡夫定律 (Metcalfe's Law)

摩尔定律 (Moore's Law)

墨菲定律 (Murphy's Law / Sod's Law)

奥卡姆剃刀 (Occam's Razor)

帕金森定理 (Parkinson's Law)

过早优化效应 (Premature Optimization Effect)

普特定律 (Putt's Law)

里德定律 (Reed's Law)

复杂性守恒定律 (The Law of Conservation of Complexity or Tesler's Law)

抽象泄漏定律 (The Law of Leaky Abstractions)

帕金森琐碎定理 (The Law of Triviality)

Unix 哲学 (The Unix Philosophy)

Spotify 模型 (The Spotify Model)

沃德勒定律 (Wadler's Law)

惠顿定律 (Wheaton's Law)

呆伯特法则 (The Dilbert Principle)

帕累托法则 (The Pareto Principle or The 80/20 Rule)

彼得原理 (The Peter Principle)

鲁棒性原则 (The Robustness Principle or Postel's Law)

SOLID

单一功能原则 (The Single Responsibility Principle)

开闭原则 (The Open/Closed Principle)

里氏替换原则 (The Liskov Substitution Principle)

接口隔离原则 (The Interface Segregation Principle)

依赖反转原则 (The Dependency Inversion Principle)

不要重复你自己原则 (The DRY Principle)

KISS 原则 (The KISS Principle)

你不需要它原则 (YAGNI)

分布式计算的谬论 (The Fallacies of Distributed Computing)

课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
10分钟

接口隔离原则 (The Interface Segregation Principle)

不应强制任何客户端依赖于它不使用的方法。

SOLID 的第四个原则。该原则指出组件的消费者不应该依赖于它实际上不使用的组件函数。

举一个例子,假设我们有一个方法,读取 XML 文档。它只需要读取文件中的字节,向前移动或向后移动。如果由于一个与文件结构不相关的功能发生更改(例如更新文件安全性的权限模型),需要更新此方法,则该原则已失效。文件最好实现 可查询流 接口,并让 XML 读取器使用该接口。

该原则与面向对象编程紧密相关,其中接口,层次结构和抽象类型用于不同组件的 minimise the coupling。 Duck typing 是一种通过消除显式接口来强制执行该原则的方法。

参见: