Stay Hungry,Stay Foolish!

Continuous Design

Continuous Design

https://www.martinfowler.com/ieeeSoftware/continuousDesign.pdf

 

T
he
rising popularity of refactoring, tools
such as JUnit, and agile methodologies
such as Extreme Programming (XP) has
brought a new style of design into view.
Continuous design
is the process of us-
ing refactoring to continuously improve
a program’s design. Initially a skeptic, I’ve been
experimenting with continuous design for four

years, and it’s changed the way I program

 

 

Design Goals in Continuous Design
Continuous design makes change easy by focusing on these design goals:
DRY (Don’t Repeat Yourself):
There’s little duplication.
Explicit:
Code clearly states its purpose, usually without needing comments.
Simple:
Specific approaches are preferred over generic ones. Design pat-
terns support features, not extensibility.
Cohesive:
Related code and concepts are grouped together.
Decoupled:
Unrelated code and concepts can be changed independently.
Isolated:
Third-party code is isolated behind a single interface.
Present-day:
The design doesn’t try to predict future features.
No hooks:
Interfaces, factory methods, events, and other extensibility “hooks”

are left out unless they meet a current need

 

Cohesive

内聚 -- 相关的代码和逻辑,放在一起。 不要离散存放。

Isolated & Decoupled

去耦合 -- 将无关和不必要的粘连,切除掉。目标为更加内聚。

隔离 -- 将不同内聚的模块, 切分清楚, 将模块之间的接口描述清楚。

 

posted @   lightsong  阅读(237)  评论(0编辑  收藏  举报
编辑推荐:
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
阅读排行:
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 全程使用 AI 从 0 到 1 写了个小工具
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
千山鸟飞绝,万径人踪灭
点击右上角即可分享
微信分享提示