建议零售价和“变革轴”?

发布于 2024-09-04 12:48:55 字数 269 浏览 2 评论 0原文

我正在阅读 Bob Martin 的 OOD 原则,特别是 SRP 文本,并且我很好地理解它所说的精神,但我不太理解链接第 2 页(本书第 150 页)中的特定措辞:

我解释说:

将这两个职责分成不同的类很重要,因为每项责任都是一个变革轴

“变革轴”到底是什么意思?

I'm reading Bob Martin's principles of OOD, specifically the SRP text, and I understand the spirit of what it's saying pretty well, but I don't quite understand a particular phrasing, from page 2 of the link (page 150 of the book):

I paraphrase:

It is important to separate these two responsibilities into separate classes because each responsibility is an axis of change.

What exactly is meant here by "axis of change"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

饮湿 2024-09-11 12:48:55

变化围绕着轴线发生,这表明每个职责都是班级存在的中心点。您希望类有一个存在的理由,以便更容易管理更改。

Changes occur around the axis and that suggest that each responsibility acts as a central point for the class's existence. You want a class to have a single reason to exist such that changes are easier to manage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文