use calculator examples to illustrate these two principles, but it seems that the difference is that OCP has an abstract class, while SRP does not inherit abstraction
compared with SRP, OCP, the examples of
1.OCP are all independent of each function. Doesn"t this accomplish a single responsibility?
2. Then it is said that OCP can be open to extension, and SRP can also do it. When other operations are needed, just add a corresponding class. It"s just that compared with OCP, it doesn"t inherit abstractions to constrain classes, so I don"t quite understand the difference here
.3. And what does the so-called "modified closure" mean? I don"t quite understand. I don"t know which class I"m talking about. After all, even though it"s easy to extend (add) an operation class to OCP, you still have to modify it in the home page (add one level in if else or switch case)
.4. Many materials say that they inherit abstraction, so they don"t understand the modification
.