我建议你将开闭原则作为一个设计方向而非一个完全的目标。
I would recommend that you treat the Open Closed Principle as a design vector rather than an outright goal.
如果你可以通过实现IDataSource对这个系统进行扩展并且不对BusinessProcess类做任何的修改,那么这个设计就遵循了开闭原则。
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类做任何的修改,那么这个设计就遵循了开闭原则。
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.
应用推荐