博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
经典的软件开发哲学
阅读量:5739 次
发布时间:2019-06-18

本文共 2975 字,大约阅读时间需要 9 分钟。

hot3.png

DRY:Don’t Repeat Yourself -泛型设计

KISS:Keep it simple, stupid-简单原则

Program to an interface, not an implementation-注重接口,而不是实现,依赖接口,而不是实现

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

You Ain’t Gonna Need It (YAGNI) -避免过度设计原则

Law of Demeter – 迪米特法则,最少知识原则,解耦合原则

面向对象的S.O.L.I.D 原则:

Single Responsibility Principle (SRP) – 职责单一原则:一个类,只做一件事,并把这件事做好

Open/Closed Principle (OCP) – 开闭原则:模块对扩展是开放的,而对修改是封闭的

Liskov substitution principle (LSP) – 里氏替换原则:子类能替换基类

Interface Segregation Principle (ISP) – 接口隔离原则:功能实现在接口,不同功能不同接口彼此隔离

Dependency Inversion Principle (DIP) – 依赖倒置原则:高层模块不应该依赖于低层模块的实现,而是依赖于高层抽象。

 

Common Closure Principle(CCP)– 共同封闭原则:把因为某个同样的原因而需要修改的所有类组合进一个包里

Common Reuse Principle (CRP) – 共同重用原则:没有被一起重用的类不应该被组合在一起。

Hollywood Principle – 好莱坞原则:所有的组件都是被动的,所有的组件初始化和调用都由容器负责。

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

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

Separation of Concerns (SoC) – 关注点分离:将一个问题分解为独立且较小的问题

Design by Contract (DbC) – 契约式设计:子类前提条件不强于基类;后续条件不弱于基类.

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

 

UNIX的哲学:

  • Write programs that do one thing and do it well.

  • Write programs to work together.

  • Write programs to handle text streams, because that is a universal interface.

The Art of Unix Programming

  • Rule of Modularity: Write simple parts connected by clean interfaces.

  • Rule of Clarity: Clarity is better than cleverness.

  • Rule of Composition: Design programs to be connected to other programs.

  • Rule of Separation: Separate policy from mechanism; separate interfaces from engines.

  • Rule of Simplicity: Design for simplicity; add complexity only where you must.

  • Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.

  • Rule of Transparency: Design for visibility to make inspection and debugging easier.

  • Rule of Robustness: Robustness is the child of transparency and simplicity.

  • Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.

  • Rule of Least Surprise: In interface design, always do the least surprising thing.

  • Rule of Silence: When a program has nothing surprising to say, it should say nothing.

  • Rule of Repair: When you must fail, fail noisily and as soon as possible.

  • Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.

  • Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.

  • Rule of Optimization: Prototype before polishing. Get it working before you optimize it.

  • Rule of Diversity: Distrust all claims for “one true way”.

  • Rule of Extensibility: Design for the future, because it will be here sooner than you think.

X Window的哲学:

  1. Small is beautiful.

  2. Make each program do one thing well.

  3. Build a prototype as soon as possible.

  4. Choose portability over efficiency.

  5. Store data in flat text files.

  6. Use software leverage to your advantage.

  7. Use shell scripts to increase leverage and portability.

  8. Avoid captive user interfaces.

  9. Make every program a filter.

转载于:https://my.oschina.net/u/66632/blog/290000

你可能感兴趣的文章
ProbS CF matlab源代码(二分系统)(原创作品,转载注明出处,谢谢!)
查看>>
OC中KVC的注意点
查看>>
JQ入门(至回调函数)
查看>>
【洛天依】几首歌的翻唱(无伴奏)
查看>>
OpenSSL初瞻及本系列的博文的缘由
查看>>
ISO8583接口的详细资料
查看>>
tmux不自动加载配置文件.tmux.conf
查看>>
经验分享:JavaScript小技巧
查看>>
[MOSEK] Stupid things when using mosek
查看>>
程序实例---栈的顺序实现和链式实现
查看>>
服务的使用
查看>>
Oracle 用户与模式
查看>>
MairDB 初始数据库与表 (二)
查看>>
拥在怀里
查看>>
chm文件打开,有目录无内容
查看>>
whereis、find、which、locate的区别
查看>>
一点不懂到小白的linux系统运维经历分享
查看>>
桌面支持--打不开网页上的pdf附件解决办法(ie-tools-compatibility)
查看>>
nagios监控windows 改了NSclient++默认端口 注意事项
查看>>
干货 | JAVA代码引起的NATIVE野指针问题(上)
查看>>