1. 问题及方案
- 职责不清晰:Move Field、Move Method;
- 类承担过多职责:Extract Class;
- 类职责过少:Inline Class;
- 类之间关联:Hide Delegate、Remove Middle Man;
- 不能访问类的源码,却又想添加职责:Introduce Foreign Method、Introduce Local Extension;
个人博客
将标识符的首字母和后面连接的每个单词的首字母都大写。可以对三字符或更多字符的标识符使用Pascal 大小写。例如: BackColor。
标识符的首字母小写,而每个后面连接的单词的首字母都大写。例如:backColor。
控制在 120 字符左右。
缩进应该是每行一个Tab(4个空格),不要在代码中使用Tab字符。VS设置
:工具->选项->文本编辑器->C#->制表符->插入空格
空行是为了将逻辑上相关联的代码分块,以便提高代码的可阅读性。
在以下情况下使用两个空行
在以下情况下使用一个空行
1 | //=========================================================== |
1 | /// <summary> |
命名命名空间时的一般性规则是使用公司名称,后跟项目名称和可选的功能与设计。示例
:namespace CompanyName.ProjectName.ModuleName
ps
:C# 中通常字段只有 private,若需暴露,请使用属性。REST (Representational State Transfer) was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation(博士论文). REST is an architectural style for designing distributed systems. It is not a standard but a set of constraints(约束), such as being stateless, having a client/server relationship, and a uniform interface. REST is not strictly related to HTTP, but it is most commonly associated with it.