open-closed-principle
Good examples of OCP in open source libraries [closed]
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.[详细]
2023-03-31 02:56 分类:问答Is this the Open/Closed principle? And if not
Considering the following code public interface IEntity { int Id { get; set; } } public class User : IEntity {[详细]
2023-03-08 04:38 分类:问答Open/Closed for flexible software
The title may not be too descriptive, but I couldn\'t think of a better one. I\'m sorry for that. So, the problem I am having here is one I have come across a couple of times now. It\'s really about[详细]
2023-03-03 03:05 分类:问答Understanding the Open Closed Principle
I was refactoring some old code of a simple script file parser when I came across the following code:[详细]
2023-02-19 23:49 分类:问答Are there any benefits to following the open/closed principle when using BDD?
The open/closed principle seems to be about preventing regressions in an object or method. Given that your code is covered by tests because you\'re practicing BDD this seems a redundant requirement. I[详细]
2023-02-06 22:26 分类:问答How do you write code that conforms to the OCP?
I have recently been trying to learn about basic design principles and the OCP has me a bit confused. It makes sense that when a change happens it is preferable to extend the system rather than modify[详细]
2023-01-21 10:15 分类:问答Using IoC and Dependency Injection, how to wrap code with a new layer of implementation without violating the Open-Closed principle?
I\'m trying to figure out how this would be done in practice, so as not to violate the Open Closed principle.[详细]
2022-12-23 07:57 分类:问答Does the Factory Method pattern violate the Open/Closed principle?
Does the Factory Method pattern (not to be confused with the Factory or Abstract Factory patterns) violate the Open/Closed principle?[详细]
2022-12-22 02:43 分类:问答