开发者

SRP & "axis of change"?

开发者 https://www.devze.com 2023-01-01 15:24 出处:网络
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 particul开发者_高级运维ar phrasin

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 particul开发者_高级运维ar 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"?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消