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.
如果在某一部分中,一个抽象了的类必须向下转换为特定的子类,那么你就没有遵循开闭原则。
应用推荐