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

首頁 > 開發 > 綜合 > 正文

IDesign C#編碼規范(之十一)

2024-07-21 02:18:56
字體:
來源:轉載
供稿:網友

4.7企業服務enterprise service
1.在事務方法里不要捕捉異常。要用autocomplete屬性。
do not catch exceptions in a transactional method. use the autocomplete attribute.
a) see chapter 4 in com and .net component services.
2.不要調用setcomplete(), setabort(),以及相關方法。要用autocomplete屬性。
do not call setcomplete(), setabort(), and the like. use the autocomplete attribute.
[transaction]
public class mycomponent : servicedcomponent
{
[autocomplete]
public void mymethod(long objectidentifier)
{
getstate(objectidentifier);
dowork();
savestate(objectidentifier);
}
}
3.總是覆寫canbepooled方法并且返回true(除非你有更好的原因不用返回值到池)。
always override canbepooled and return true(unless you have a good reason not to return to pool).
public class mycomponent : servicedcomponent
{
protected override bool canbepooled()
{
return true;
}
}
4.總是在對象池里顯示地調用dispose(),除非該組件已被配置為使用jita。
always call dispose() explicitly on a pooled objects unless the component is configured to use jita as well.
5.當組建使用jita時不可調用dispose()。
never call dispose() when the components uses jita.
6.總是為應用程序和組件設置權限水平。
always set authorization level to application and component.
7.將所有應用程序的檢證水平設置為私有。
set authentication level to privacy on all applications.
[assembly: applicationactivation(activationoption.server)]
[assembly: applicationaccesscontrol(
true, //authorization
accesscheckslevel = accesschecksleveloption.applicationcomponent,
authentication = authenticationoption.privacy,
impersonationlevel = impersonationleveloption.identify)]
8.將客戶端程序集的角色水平設置為identity。
set impersonation level on client assemblies to identity.
9.總是將可服務組件的componentaccesscontrol屬性設置為true。
always set componentaccesscontrol attribute on serviced components to true.
a)the default is true
[componentaccesscontrol]
public class mycomponent : servicedcomponent
{…}
10.總是將每一個用戶角色設置為marshaler。
always add to the marshaler role the everyone user.
[assembly: securerole(“marshaler”, seteveryoneaccess = true)]
11.應用securemethod屬性于所有的要求檢證的類。
apply securemethod attribute to all classes requiring authentication.
[securitymethod]
public class mycomponent : servicedcomponent
{…}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泾川县| 三穗县| 灵石县| 婺源县| 孙吴县| 张掖市| 南木林县| 自贡市| 汉沽区| 宁乡县| 娱乐| 涟水县| 洛阳市| 金川县| 绥江县| 布尔津县| 方正县| 阳曲县| 麟游县| 江阴市| 定南县| 海阳市| 临西县| 德令哈市| 苏尼特左旗| 永德县| 青海省| 卢湾区| 汉川市| 嘉黎县| 收藏| 保定市| 陇南市| 砚山县| 宜阳县| 太白县| 文安县| 贵州省| 志丹县| 松桃| 东乌珠穆沁旗|