I would recommend that you treat the Open Closed Principle as a design vector rather than an outright goal.
我建议你将开闭原则作为一个设计方向而非一个完全的目标。
If a class that uses an abstraction has to downcast to a specific subclass in one section, you're not following the Open Closed Principle.
如果在某一部分中,一个抽象了的类必须向下转换为特定的子类,那么你就没有遵循开闭原则。
By following the Open Closed Principle with the order processing rules, I've made it much easier to add new types of order handling logic to the system.
通过在订单处理规则上遵循开闭原则,我使得在系统中添加新类型的订单处理逻辑容易得多。
The design follows the Open Closed Principle if you can extend the system by swapping out implementations of IDataSource without making any change to the BusinessProcess class.
如果你可以通过实现IDataSource对这个系统进行扩展并且不对BusinessProcess类做任何的修改,那么这个设计就遵循了开闭原则。
In following the Open Closed Principle, I want to be able to write a class or a method and then turn my back on it, comfortable that it does its job and I won't have to go back and change it.
在遵循开闭原则的过程中,我期望能够写出一个类或者方法,在以后我回过头读它的时候,会很舒服地看到它能完成它的工作并且我也不需要再修改它。
You may not always manage to write code that satisfies the Open Closed Principle in every aspect, but even moving partway there can be beneficial.
你可能并非总是试图写一些在各个方面都满足开闭原则的代码,但是即使只进行到中途也是非常有益的。
Analyzed the structure and mathematical model of linear servo system based on open-closed loop iterative learning position regulation in detail.
详细分析了开闭环迭代学习位置调节下的直线伺服系统结构与数学模型。
Given the structure of position regulator of linear servo system and open-closed loop iterative learning position regulation algorithm with forgetting factor.
给出直线伺服系统位置调节器结构及带有遗忘因子的开闭环迭代学习位置调节算法。
Given the structure of position regulator of linear servo system and open-closed loop iterative learning position regulation algorithm with forgetting factor.
给出直线伺服系统位置调节器结构及带有遗忘因子的开闭环迭代学习位置调节算法。
应用推荐