分离关注 – 单一责任原则和关注分离之间的差异

单一责任原则和关注的分离有什么区别?

Single Responsibility Principle (SRP)-
give each class just one reason to
change; and “Reason to change” ==
“responsibility”. In example: Invoice
class does not have a responsibility
to print itself.

Separation of Concerns (since 1974).
Concern == feature of system. Taking
care of each of the concerns: for each
one concern,other concerns are
irrelevant. Hiding implementation of
behavior.

here

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...