项目作者: emil14

项目描述 :
Five architecture principles explained with Golang!
高级语言:
项目地址: git://github.com/emil14/solid.git
创建时间: 2021-04-04T17:09:05Z
项目社区:https://github.com/emil14/solid

开源协议:

下载


SOLID

  • Single responsibility principle (SPR)
  • Open-closed principle (OCP)
  • Liskov substitution principle (LSP)
  • Interface segregation principle (ISP)
  • Dependency inversion principle (DIP)

Single responsibility principle (SPR)

A class should have only one reason to change.

Robert C. Martin

Open-closed principle (OCP)

Software entities should be open for extension, but closed for modification

Bertrand Meyer

Liskov substitution principle (LSP)

Let Φ(x) be a property provable about objects x of type T. Then Φ(y) should be true for objects y of type S where S is a subtype of T.

Barbara Liskov

Interface segregation principle (ISP)

No client should be forced to depend on methods it does not use.

Robert C. Martin

Dependency inversion principle (DIP)

A. High-level modules should not depend on low-level modules. Both should depend on abstractions.

B. Abstractions should not depend on details. Details should depend on abstractions.

Robert C. Martin