国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

IDesign C#編碼規(guī)范(之五)

2024-07-21 02:25:13
字體:
供稿:網(wǎng)友


收集最實用的網(wǎng)頁特效代碼!

續(xù)四,休息天翻得很少,不過總算在keep doing,:-)

4 framework特別指導
framework specific guidelines
4.1 數(shù)據(jù)訪問
data access
1. 總是使用類型安全的數(shù)據(jù)集或者數(shù)據(jù)表。避免使用原始的ado.net。
always use type-safe data sets or data tables . avoid raw ado.net.
2. 訪問數(shù)據(jù)庫時總是使用事務(wù)。
always use transactions when accessing a database.
a) 總是使用服務(wù)組件事務(wù)。
always use enterprise services transactions.
b) 不要使用ado.net事務(wù)。
do not use ado.net transactions.
3. 總是將事務(wù)隔離級別設(shè)置為序列的。
always use transaction isolation level set to serializable.
a) 使用其它隔離級別需要管理層決定。
requires management decision to use anything else.
4. 不要使用服務(wù)器瀏覽器將數(shù)據(jù)庫連接拖到windows表單、asp.net表單或web服務(wù)中。這樣做耦合了界面層和數(shù)據(jù)層。
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的組件以調(diào)用該組件客戶端不同的身份運行。
run components accessing sql server under separate identity from that of the calling client.
7. 總是在高層用類型安全的類包裝存儲過程。僅在那個類中調(diào)用存儲過程。
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.

待續(xù)。忽然想到曾閱讀過一篇關(guān)于business layer的文章,總體是責問有多少程序真正有business layer,文中甚至倡議presentation layer中不要引用system.data命名空間,你做得到嗎?小雞射手還不行,嘻嘻...

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 凤台县| 浠水县| 苏尼特右旗| 郴州市| 南江县| 迁西县| 沙洋县| 湘潭县| 洛浦县| 古丈县| 建平县| 茂名市| 靖西县| 莆田市| 泽州县| 乐安县| 惠东县| 高陵县| 青浦区| 安仁县| 封开县| 重庆市| 木兰县| 武隆县| 正蓝旗| 太仓市| 中宁县| 内黄县| 烟台市| 奉新县| 渑池县| 佛学| 长顺县| 得荣县| 西华县| 广元市| 黄平县| 铜梁县| 白沙| 凤翔县| 双牌县|