Design Principle, Design Patterns And Refactoring
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
如何创建一个对象? 采用多层的办法,可以获得更强的对象 => 1. new class;
2. Create() { ... }
public SimpleSamepleEntity Create()
ProxyGenerator generator = new ProxyGenerator();
CallingLogInterceptor interceptor = new CallingLogInterceptor();
SimpleSamepleEntity entity = generator.CreateClassProxy<SimpleSamepleEntity>(interceptor);
return entity ;
}
ProxyGenerator generator = new ProxyGenerator();
var options = new ProxyGenerationOptions(new InterceptorFilter()) { Selector = new InterceptorSelector() };
SimpleSamepleEntity entity = generator.CreateClassProxy<SimpleSamepleEntity>(
options,
new SimpleLogInterceptor(), new CallingLogInterceptor());
entity.Name = "Richie";
entity.Age = ;
3. Object factor =>
Template of Define a class ?? => virtual, interface, delegate. 有些工具,像AOP,MOQ 只适用于virtual, interface. 因此,写类时要考虑。
c#-回调callback是什么原理,机制? C# =>
调用者(Caller)向回调函数(Callee)发出调用,被调用函数启动后,不等被调函数执行完毕,程序执行流立即返回到调用者继续执行。此时,程序中至少有两个执行流,一个是调用者执行流;另一个是被调用函数执行流同时执行。当被调函数所执行处理完毕时,被调函数反过来调用一个指定的函数(称为回调函数)向调用者返回处理结果或通知调用者处理结束。这个过程称为回调(Callback)。通常,调用者发出调用时,以函数参数方式将回调函数传递给被调函数。 在C#中,回调过程与其他语言没有区别,只是回调函数是以委托方式传递的。
4. Sort
5. Debug information,
6. Event => standard Event Pattern
7. Testable ? How
8. Readability ?
9. Maintainance ?
END
Design Principle, Design Patterns And Refactoring的更多相关文章
- Design Principle vs Design Pattern 设计原则 vs 设计模式
Design Principle vs Design Pattern设计原则 vs 设计模式 来源:https://www.tutorialsteacher.com/articles/differen ...
- 设计原则 Design Principle
Design Principle设计原则 最近由于碰到要参与设计一个音频处理系统,有人提议用一个大的全局变量结构体来做状态信息交流的地方,引起了我对设计一个系统的思考,于是找到了如下资料,当然,关于这 ...
- design principle:java 回调与委派/委托机制
博客 design principle:模拟 android Button 控件点击事件 主要说了一下模拟 android 的 Listener 模式,其实这就是一种委派与回调机制的体现. 委派,也可 ...
- [Design Patterns] 2. Design principle
Single Responsibility Principle 类的设计趋向于:Use Case Diagram --> (derived) --> Detail Open-Closed ...
- Design Principle
原文地址:面向对象设计模式原则详解 http://blog.csdn.net/hguisu/article/details/7571617 程序员必备的七大面向对象设计原则(一) http://www ...
- [Arch] 02. Design principle and Software Pattern
Ref: 软件设计的七大原则 有时间的话,还需进一步深入理解. Figure, 重要的前五个原则 单一职责原则 (Simple responsibility pinciple SRP) 类的设计趋向于 ...
- 设计模式-设计原则(Design Principle)
本文由@呆代待殆原创,转载请注明出处. 写在前面:所谓设计原则并不是一定要遵守的法则,只是一种建议,因为保持这些原则本身会有一定代价,若是这些代价超过了带来的好处就得不偿失了,所以一切还是以简单为准. ...
- [读书笔记]设计原本[The Design of Design]
第1章 设计之命题 1.设计首先诞生于脑海里,再慢慢逐步成形(实现) 2.好的设计具有概念完整性:统一.经济.清晰.优雅.利落.漂亮... 第2章 工程师怎样进行设计思维——理性模型 1.有序模型的有 ...
- BookNote: Refactoring - Improving the Design of Existing Code
BookNote: Refactoring - Improving the Design of Existing Code From "Refactoring - Improving the ...
随机推荐
- AB PLC与西门子S7-1200以太网通信
前言:在项目实际应用中,经常会遇到两个不同厂家的PLC需要互联进行通信交换数据,由于各自的通信协议有所不同,实现起来的难度较大,通常的做法是借助第三方的网关.本文介绍的是AB PLC与西门子S7-12 ...
- 快速查看linux命令的用法----------TLDR
之前我们如果用一个命令,但是忘了具体的参数是什么的时候,通常会用man,比如 man tar 但是man有时候特别的冗长,你要找到想要的例子非常困难,所以tldr命令就是一个很好的补充,里边会有经常用 ...
- A Boring Problem UVALive - 7676 (二项式定理+前缀和)
题目链接: I - A Boring Problem UVALive - 7676 题目大意:就是求给定的式子. 学习的网址:https://blog.csdn.net/weixin_37517391 ...
- phpstudy 2016 切换Nginx+php7.0版本所需运行库 vc14 + 安装redis拓展
去微软官方下载vc14的运行库 链接:https://www.microsoft.com/en-us/download/details.aspx?id=48145 32位运行库 安装成功 切换版本成功 ...
- 微信小程序【获取验证码】倒计时效果
最近开始接触微信小程序,会记录一些相关的小功能——例如这次是点击[获取验证码]按钮出现的倒计时效果. 原文: http://blog.csdn.net/Wu_shuxuan/article/detai ...
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
安装了mysql5.7.19后,执行语句中只要含有group by 就会报这个错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GRO ...
- 【转】协同开发中SVN使用规范试用
转自:http://www.cnblogs.com/BraveCheng/archive/2012/07/02/2573617.html 协同开发中SVN使用规范试用 目标,要求 本次svn提交规范主 ...
- powerdesigner添加mysql的字符集支持
一般建模可能都会用到:powerdesigner 但是,在建表的时候,我一直没有找到: DEFAULT CHARACTER SET COLLATE 两个选项.因此,想了个方法,点击:工具栏->d ...
- innodb文件损坏处理
innodb文件损坏报错如下: 2018-09-03T09:52:43.486363Z 0 [ERROR] InnoDB: Space id and page no stored in the pag ...
- HDR拍照
HDR 拍照: (High Dynamic Range Imaging)高动态范围成像,是用来实现比普通数字图像技术更大曝光动态范围(即更大的明暗差别)的一组技术.高动态范围成像的目的就 ...