dev205企业程序库enterpriselibrary内容摘要:
tsByCategory, Category) 39。 Note: connection was closed by ExecuteDataSet method call End Function Security Crypto Configuration Data Access Logging Caching Exceptions 长生剑-异常处理程序块 Config Tool 异常处理程序块-攻如风,守似磐 异常处理程序块为系统的不同层面提供了一致的例外处理策略 异常由配置工具进行定义和维护 – 不需要通过编码控制例外处理 定义 “ 异常策略 ” ,可指定该策略发生时的行为 将异常写入日志 用另外一个异常进行封装 采用不同的异常替代以便隐藏敏感的异常信息 创建自己的 Handler ,提供附加的处理行为 异常处理程序块示例 DataSet customersDataSet try { customersDataSet = RunQuery(“GetAllCustomers”)。 } catch(Exception ex) { string formattedInfo = FormatException(ex)。 (formattedInfo) Throw new DataAccessException(“Database access failure for query GetAllCustomers”,e) } Without Exception Handling App Block DataSet customersDataSet try { // Some code that may throw customersDataSet = RunQuery(“GetAllCustomers”)。 } catch(Exception ex) { if ((ex, “Data Access Policy”)) throw。 } Exception policy: “Data Access Policy” Exception type: Exception Handler: Logging Handler Wrap Handler With Exception Handling App Block Security Crypto Configuration Data Access Logging Caching Exceptions 离别钩-缓存程序块 Config Tool 缓存。dev205企业程序库enterpriselibrary
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。
用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。