大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> NET专区 -> IDesign C#编码规范(之五)

IDesign C#编码规范(之五)

时间: 2021-07-31 作者:daque

续四,休憩天翻得很少,然而总算在keep doing,:-)4 framework更加引导 framework specific guidelines 4.1 数据考察 data access 1. 老是运用典型安定的数据集大概数据表。制止运用原始的ado.net。 always use type-safe data sets or data tables . avoid raw ado.net. 2. 考察数据库时老是运用工作。 always use transactions when accessing a database. a) 老是运用效劳组件工作。 always use enterprise services transactions. b) 不要运用ado.net工作。 do not use ado.net transactions. 3. 老是将工作分隔级别树立为序列的。 always use transaction isolation level set to serializable. a) 运用其它分隔级别须要处置层确定。 requires management decision to use anything else. 4. 不要运用效劳器欣赏器将数据库贯穿拖到windows表单、asp.net表单或web效劳中。如许做啮合了界面层和数据层。 do not use the server explorer to drop connections on windows forms, asp.net forms or web services. doing so couples the presentation tier to the data tier. 5. 制止运用sql server考证。 avoid sql server authentication. a) 而是运用windows考证。 use windows authentication instead. 6. 将考察sql server的组件以挪用该组件存户端各别的身份运转。 run components accessing sql server under separate identity from that of the calling client. 7. 老是在高层用典型安定的类包装保存进程。仅在谁人类中挪用保存进程。 always wrap your stored procedures in a high level, type safe class. only that class invokes the stored procedures. 8. 制止在保存进程中纵容何论理。 avoid putting any logic inside a stored procedure. a) 即使保存进程中有if,你大概犯了缺点。 if there is an if inside a stored procedure, you are doing something wrong. 待续。遽然想到曾观赏过一篇对于business layer的作品,总体是诽谤有几何步调真实有business layer,文中以至呼吁presentation layer中不要援用system.data定名空间,你做获得吗?角雉弓手还不行,嘻嘻...

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.