建议零售价和“变革轴”?
我正在阅读 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
变化围绕着轴线发生,这表明每个职责都是班级存在的中心点。您希望类有一个存在的理由,以便更容易管理更改。
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.