Laws, Principles

本文汇总了多种重要的软件设计原则,包括无环依赖原则、命令-查询分离原则、共同重用原则等,旨在帮助开发者更好地理解和应用这些原则,提高软件质量和可维护性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Acyclic Dependencies Principle (ADP).  无环依赖原则

 

Command-Query Separation (CQS).  命令-查询分离原则

 

Common Reuse Principle (CRP).  共同重用原则

 

Convention over Configuration(CoC).  惯例优于配置原则

 

Dependency Inversion Principle (DIP). 依赖倒置原则

 

Design by Contract (DbC).  契约式设计

 

Don’t Repeat Yourself (DRY).

 

Hollywood Principle. 好莱坞原则

 

High Cohesion & Low/Loose coupling &.  高内聚, 低耦合

 

Law of Demeter.  迪米特法则

 

LeBlanc’s law: Later equals never.   勒布朗法则:稍后等于永不。

 

Liskov substitution principle (LSP).   里氏代换原则

 

Interface Segregation Principle (ISP). 接口隔离原则

 

Open/Closed Principle (OCP).  开闭原则

 

Program to an interface, not an implementation.

 

Separation of Concerns (SoC).  关注点分离

 

Single Responsibility Principle (SRP) .  单一职责原则

 

Tell, Don’t Ask  命令,不要去询问原则

 

Ward’s principle: You know you are working on clean code when each routine turns out to be pretty much what you expected.

沃德原则:如果每个例程都让你感到深合己意,那就是整洁代码。

 

You Ain’t Gonna Need It (YAGNI).

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值