国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 安阳市| 庆城县| 景东| 洪洞县| 眉山市| 新龙县| 民乐县| 叙永县| 晴隆县| 土默特右旗| 通化县| 封开县| 安化县| 穆棱市| 昌宁县| 依兰县| 太白县| 墨玉县| 平阴县| 察隅县| 将乐县| 曲麻莱县| 肇庆市| 文化| 雅安市| 通辽市| 蚌埠市| 随州市| 瑞昌市| 北安市| 八宿县| 清水县| 璧山县| 嘉鱼县| 乌兰察布市| 教育| 司法| 屯门区| 精河县| 甘肃省| 通城县|