So, did this solution conform to the Open Closed Principle?
那么,这个解决方案遵守了开闭原则么?
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.
在遵循开闭原则的过程中,我期望能够写出一个类或者方法,在以后我回过头读它的时候,会很舒服地看到它能完成它的工作并且我也不需要再修改它。
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.
如果在某一部分中,一个抽象了的类必须向下转换为特定的子类,那么你就没有遵循开闭原则。
As I said earlier, the most common manifestation of the Open Closed Principle is using polymorphism to substitute an existing part of the application with a brand new class.
如果我前面所说的,使用开闭原则最通常的做法就是使用多态去用一个全新的类替换程序中现存的一部分。
I would recommend that you treat the Open Closed Principle as a design vector rather than an outright goal.
我建议你将开闭原则作为一个设计方向而非一个完全的目标。
This is where the Open Closed Principle comes into play.
这就是开闭原则一展身手的地方了。
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.
通过在订单处理规则上遵循开闭原则,我使得在系统中添加新类型的订单处理逻辑容易得多。
There is another way to move closer to the Open Closed Principle ideal that might be cleaner in the end.
最后,还有一种更靠近开闭原则的方式需要说明。
You'll never reach true Open Closed nirvana, but you can inch much closer by rigorously following the related Single Responsibility Principle: a class should have one, and only one, reason to change
你永远也达不到真正的开闭天堂,但是通过严格地遵循与之相关的单一责任原则:一个类应该有并且只有一个更改的理由,你可以非常靠近地接近它。
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类做任何的修改,那么这个设计就遵循了开闭原则。
I'd like to start with a discussion of the Open Closed Principle and other related ideas popularized by Robert C. Martin in his book, Agile Software Development, Principles, Patterns, and Practices.
我喜欢以讨论开闭原则和其他由robertC.M artin在其著作《敏捷软件开发,原则,模式和实践》中所倡导的相关主题作为开始。
A similar approach is necessary to explain the principle of the laser gyroscope, where open system attitude information is obtained from an apparently closed system device.
相近的原理方法有激光陀螺仪原理可以解释,激光陀螺仪从一个封闭的系统设备获取非密闭系统的信息。
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.
你可能并非总是试图写一些在各个方面都满足开闭原则的代码,但是即使只进行到中途也是非常有益的。
The problems of open-die forging for spiral bevel gears are described. A new process and new structure principle of die for closed precision die forging of spiral bevel gears are presented.
针对螺旋伞齿轮开式模锻存在的问题,提出了螺旋伞齿轮闭式精锻新工艺及其模具结构。
On the principle of path-algebra and introducing in lengthening matrix, passing array, open-closed flag and non-circuit minimal path matrix, etc.
应用路径代数原理,通过引入途经数组等,给出一种TSP的新解法。
On the principle of path-algebra and introducing in lengthening matrix, passing array, open-closed flag and non-circuit minimal path matrix, etc.
应用路径代数原理,通过引入途经数组等,给出一种TSP的新解法。
应用推荐