gpt4 book ai didi

separation-of-concerns - 单一责任原则与关注点分离的区别

转载 作者:行者123 更新时间:2023-12-03 05:24:10 27 4
gpt4 key购买 nike

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

最佳答案

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 .

关于separation-of-concerns - 单一责任原则与关注点分离的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1724469/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com