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

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 Single Responsibility Principle)

每个模块或者类只应该有一项功能。

SOLID 的第一个原则。这个原则表明模块或者类只应该做一件事。实际上,这意味着对程序功能的单个小更改,应该只需要更改一个组件。例如,更改密码验证复杂性的方式应该只需要更改程序的一部分。

理论上讲,这使代码更健壮,更容易更改。知道正在更改的组件只有一个功能,这意味着测试更改更容易。使用前面的例子,更改密码复杂性组件应该只影响与密码复杂性相关的功能。变更具有许多功能的组件可能要困难得多。

参见:

  • Object-Orientated Programming
  • SOLID