📜  java扎实的原理——Java代码示例

📅  最后修改于: 2022-03-11 14:52:06.455000             🧑  作者: Mango

代码示例1
S.O.L.I.D. principle

The Single-responsibility principle: "There should never be more than one reason for a class to change."[5] In other words, every class should have only one responsibility.[6]

The Open–closed principle: "software entities ... should be open for extension, but closed for modification."[7]

The Liskov substitution principle: objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program. See also design by contract.[8]

The Interface segregation principle: "many client-specific interfaces are better than one general-purpose interface."[9][4]

The Dependency inversion principle: "depend upon abstractions, [not] concretions."[10][4]