定律与定理 › 原理

单一功能原则

single responsibility principle

computer-programming principle that states that every class in a computer program should have responsibility over a single part of that program's functionality, which it should encapsulate

在面向对象编程领域中,单一功能原则 规定每个类都应该有一个单一的功能,并且该功能应该由这个类完全封装起来。所有它的(这个类的)服务都应该严密的和该功能平行。

摘自维基百科「单一功能原则」,CC BY-SA 4.0

属于
SOLID