开发者

SRP Algorithm Design

开发者 https://www.devze.com 2023-04-06 11:40 出处:网络
I am reading Uncle Bob\'s Agile PPP, Specifically i am reading the SRP part of it, while reading about the principle i got a doubt that is it not that SRP is increasing the coupling in our design with

I am reading Uncle Bob's Agile PPP, Specifically i am reading the SRP part of it, while reading about the principle i got a doubt that is it not that SRP is increasing the coupling in our design with so many small-small classes inter-dependent on开发者_如何学C each other? I know the book says that it reduces coupling but i didn't understand how?


If a class has more than one responsibility then you are coupling those responsibilities together in the one class. By separating them out into their own classes the responsibilities are being decoupled and now each class only has one reason to change.

0

精彩评论

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

关注公众号