Enterprise Library 5.0.pptxVIP

  • 2
  • 0
  • 约5.35千字
  • 约 39页
  • 2017-04-04 发布于江苏
  • 举报
Enterprise Library 5.0

What’s New In Enterprise Library 5.0: Session Objectives and Takeaways Session Objective(s): Show what’s new in Enterprise Library 5.0 Enhanced User Experience Simplicity for the Win! Learnability Discoverability EntLib 5.0 released April 14th EntLib 4.x 4 container.ResolveDatabase(“Foo”); … Conceptual Architecture Functional blocks Common Infrastructure Structural/wiring blocks Security Data Access Cryptography Validation Logging Caching Exception Handling Unity Config Instrumen- tation Policy Injection Enterprise Library – Conceptual Architecture What’s New? .NET 4.0 / VS 2010 Binaries Target .NET 3.5 SP1 Work unchanged in .NET 4.0 projects Source VS 2008 sln/proj targeting 3.5 SP1 VS 2010 sln/proj targeting 4.0 Config tool Fully integrated editor in VS 2008 Launcher from VS 2010 (like WCF config tool) Processing Results from Sprocs Data Access block traditionally made it easier to call stored procedures (sprocs) Processing the results still means dropping back into classic ADO.NET code Issue: how could we make it easier to consume the results of a sproc? LINQ Style Result Processing Basic idea: Instead of a datareader from a query, get back an IEnumerableT Now we can do LINQ to Objects Introduced Accessors provide a higher level abstraction that combines input mapping, output mapping, and result set management into a single object. Note: Accessors are easily injectable Demo DAAB Accessors Async DAAB Database API addition Follows classic Begin/End async pattern NonQuery Scalar Reader XmlReader (SQL Server only) Not supported on all databases Async Data Access var db = EnterpriseLibraryContainer.Current.GetInstanceDatabase(); if(db.SupportsAsync) { db.BeginExecuteScalar(Get Top Ten Products, CompletionMethod); } public void CompletionMethod(IAsyncResult async) { int count = (int)db.EndExecuteScalar(async); ... } Logging Performance Originally, planned to implement async logging Perf analysis of the lower level operations of the logging

文档评论(0)

1亿VIP精品文档

相关文档