命名约定

  1. 编写数据类时,按照由上到下 [主键]->[内容相关性] 来编写属性。
        public class InformationRS
        {
            public string BFRef { set; get; }
    
            public string BFStatus { set; get; }
    
            public DateTime DepDate { set; get; }
    
            public DateTime Deadline { set; get; }
    
            public string CltCode { set; get; }
    
            public string CltName { set; get; }
    
            public string CltAddr { set; get; }
    
            public string BillTo { set; get; }
    
            public string Attn { set; get; }
    
            public string Tel { set; get; }
    
            public string Fax { set; get; }
    
            public InformationRS()
            {
    
            }
        }
  2. 编写方法参数的优先次序,由左到右依次 [配置]->[Profile]->[主键]->[一般参数] ->[Ref参数]->[Out参数]。
  3. 简称命名大小写规则,两个单词的简称全大写(例:Booking Folder=BF);一个单词的简称头字母大写(例:Total=Ttl)
  4. 在命名空间、类型及成员时采用PascalCasing大小写风格,除非是内部字段和私有字段。
  5. 要用camelCasing大小写风格来命名内部字段和私有字段。
  6. 要用camelCasing大小写风格来命名局部变量。
  7. 要用camelCasing大小写风格来命名方法的形式参数。
  8. camelCasing大小写风格遇到简称则简称全小写(例:BFRef=bfRef)
  9. 异常Catch时,如需调用SQL Rollback,则Rollback代码需写在Catch第一行执行。
  10. 避免给局部变量加前缀。
  11. 要使用C#语言中对应的别名,不要使用.NET框架中的类型名。 
    例如,要使用int而不是Int32,要使用object而不是Object。

作者:WM/Vinson

posted @ 2014-06-11 00:11  WTL Developers  阅读(173)  评论(0编辑  收藏  举报