https://refactoring.guru/smells/feature-envy https://stackoverflow.com/questions/1242994/effective-c-sharp-tips Inversion of control <= https://en.wikipedia.org/wiki/Inversion_of_control <= https://en.wikipedia.org/wiki/Template_method_pattern 如何创…
Design Principle vs Design Pattern设计原则 vs 设计模式 来源:https://www.tutorialsteacher.com/articles/difference-between-design-principle-and-design-pattern In software engineering, design principle and design pattern are not the same.在软件工程中,设计原则和设计模式是不同的. Des…
Design Principle设计原则 最近由于碰到要参与设计一个音频处理系统,有人提议用一个大的全局变量结构体来做状态信息交流的地方,引起了我对设计一个系统的思考,于是找到了如下资料,当然,关于这个系统也是有待验证,不能说全局变量就是不好,因为这个系统并不会并发执行,而且资源充足. 我反正有点疑虑,但是会继续验证. 以下为Gof的六大设计原则,出自<设计模式>. Single Responsibility Principle -SRP There should never be more…
Single Responsibility Principle 类的设计趋向于:Use Case Diagram --> (derived) --> Detail Open-Closed Principle /* Software entities should be open for extension, but closed for modification */ 反面例子:Dependency: 作为参数,作为局部变量,调用静态方法. 改进方式:增加抽象类或者接口,以及set方法. Li…
BookNote: Refactoring - Improving the Design of Existing Code From "Refactoring - Improving the Design of Existing Code" by Martin Flower. BookNote: Refactoring - Improving the Design of Existing Code Duplicated Code Long Method Large Class Long…