1 / 39

Introducing Enterprise Library 5.0

Introducing Enterprise Library 5.0. Tom Hollander Solution Architect Microsoft Australia Session Code: ARC302. Session Objectives And Takeaways. Session Objectives: Explain Enterprise Library 5.0 design Demonstrate key improvements Key Takeaways: User experience matters

rainer
Download Presentation

Introducing Enterprise Library 5.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introducing Enterprise Library 5.0 Tom Hollander Solution Architect Microsoft Australia Session Code: ARC302

  2. Session Objectives And Takeaways • Session Objectives: • Explain Enterprise Library 5.0 design • Demonstrate key improvements • Key Takeaways: • User experience matters • We hear your pain! • Simplicity for the win! • DI Containers everywhere • Better modularity, testability and maintainability

  3. Before the Beginning... • .NET Framework 1.0 is released • Some written guidance and sample code • Not normally production ready • Many organisations invested in their own “frameworks” 2002

  4. Genesis • First patterns & practices Application Blocks • Data Access Application Block • Exception Management Application Block • Configuration Management Application Block • Caching Application Block • Enterprise Instrumentation Framework • Emergence of partner and open source frameworks • ACA.NET, CSLA, ... 2004

  5. Enterprise Library 1.0 / 1.1 • Themes: • Consistency, Extensibility, Ease of Use, Integration • Target Platform: .NET Framework 1.1 • Blocks: • Caching, Configuration, Cryptography, Data Access, Exception Handling, Logging & Instrumentation, Security • Tools: • Standalone configuration editor 2005

  6. Enterprise Library 2.0 • Themes: • .NET Framework 2.0 platform alignment • Target Platform: .NET Framework 2.0 • Blocks: • Caching, Cryptography, Data Access, Exception Handling, Logging, Security • Tools: • Standalone configuration editor 2006

  7. Enterprise Library 3.0 / 3.1 • Themes: • New application blocks, Visual Studio integration • Target Platform: .NET Framework 2.0 & 3.0 • Blocks: • Caching, Cryptography, Data Access, Exception Handling, Logging, Security, Validation, Policy Injection • Tools: • Standalone + VS integrated configuration editor, Application Block Software Factory 2007

  8. Enterprise Library 4.0 / 4.1 • Themes: • Dependency Injection, WMI 2.0 • Target Platform: .NET Framework 3.5 • Blocks: • Caching, Cryptography, Data Access, Exception Handling, Logging, Security, Validation, Policy Injection, Unity • Tools: • Standalone + VS integrated configuration editor 2008

  9. Enterprise Library 5.0: Themes Enhanced User Experience,Simplicity for the Win! Learnability & Discoverability Accelerate Your Development!

  10. Enterprise Library 5.0: Blocks Functional blocks Infrastructure Config Instrumen-tation Data Access Logging Caching Exception Handling Structural/wiring blocks Cryptography Security Unity PolicyInjection Validation

  11. Alignment • Target binaries for .NET Framework 3.5 SP1 • Target source projects for VS2008 • Target config tool for bothVS2008 and VS2010

  12. We hear your pain!

  13. When Something Goes Wrong • Debugging • Useful info is buried deep inside the stack • Not just Unity, but entire EntLib

  14. demo Improved error messaging

  15. ObjectGraph DriveController EngineMonitor AuthorizationProvider P P EngineDataRepository EngineSensor ILogger IAuthorizationToken ConsoleLogger DefaultAuthorizationToken

  16. Logging Performance • Originally, planned to implement async logging • Perf analysis of the lower level operations of the logging block (v4.1) showed: • The formatter took 54% of the total time • Of this, the most expensive operations are: • 11.76   Getting the machine name • 9.63    Computing Severity textual representation • 5.70    Undetermined mscorwks.dll work • 5.17    Computing DateTime textual representation • 4.46    StringBuilder.Append • 4.10    Getting the process name

  17. Logging Performance Optimisation • Added predefined timestamp patterns mapped to high-speed formatting implementations. • FixedFormatISOInternationalDate: yyyy-MM-dd • FixedFormatTime: HH:mm:ss.fff • Added 4 new "local" tokens for context info • localAppDomain • localMachine • localProcessName • localProcessId • Modified default template to take advantage the above

  18. Logging Performance Optimisation Preliminary Results • Formatter responsible for ~50% of the execution time • Improvements N=1M 45% localimprovement 53% local improvement

  19. Processing Results from Sprocs • Data Access Application Block traditionally made it easier to call 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?

  20. demo DAAB Accessors

  21. LINQ Style Result Processing • Basic idea: • Instead of a DataReader from a query, get back an IEnumerable<T> • 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. • Accessors are easily injectable

  22. Config Experience • Programmatic config support • Intellisense in XML editor • Default config out of the box • Improved config tool

  23. FluentConfigurationInterface • Motivation: • Customers requested a better way to configure EntLib programmatically • Make our own test cases more readable • Fluent interface • More succinct, more readable programmatic configuration Ref: Martin Fowler, Eric Evans. http://martinfowler.com/bliki/FluentInterface.html

  24. demo Fluent Interfaces

  25. Tackling External Complexity • Single entry point • EnterpriseLibraryContainer.Current • Supporting testability in your code that uses EntLib • Using DI style with instances • Container independence • Not tied to Unity • Can build your own adapters • Preliminary perf is equivalent to v4.1 or better • Importantly: All existing user code still works

  26. Tackling Internal Complexity • Cleanup • got rid of ~200 classes! • removed layers of indirection • added ~120 classes, but less complicated • reduced # assemblies (incl. OB2 – RIP!!!!!) • Changed internals significantly • custom blocks would need to be re-written • but this should be easier now

  27. demo Getting EntLib objects

  28. Config Tool: UX Matters! • Config tool has not evolved significantly since v1 • New and occasional users fared poorly in usability studies • Is it time for a paradigm shift? • Important : • The following mock-ups are experimental and may never see the light of day • But improving config UX is a core goal of v5

  29. Config Tool Ux

  30. Learnability • Hands-On Labs • New Guides • Your feedback is invited • entlib.codeplex.com

  31. But Wait... There’s More! • Highlights • DAAB Async overloads • Unity config tool support • Unity/MEF integration • Validation WPF integration • Purge old rolling log files • Multiple config file support • Full product backlog on http://entlib.codeplex.com

  32. Key Takeaways • Improving user experience • Simpler, more consistent code base • Simpler to use • Better support for DI-style of development • Existing public API not broken

  33. Resources • www.microsoft.com/teched • Sessions On-Demand & Community • www.microsoft.com/learning • Microsoft Certification & Training Resources • http://microsoft.com/technet • Resources for IT Professionals • http://microsoft.com/msdn • Resources for Developers

  34. Enterprise Library Resources • All EntLib5 current bits: • entlib.codeplex.com • unity.codeplex.com • Released Enterprise Library and related resources: • msdn.microsoft.com/practices • msdn.microsoft.com/entlib • Enterprise Library Community: • entlib.codeplex.com • Blogs: • Tom Hollander: blogs.msdn.com/tomholl • Grigori Melnik: blogs.msdn.com/agile • Bob Brumfield: blogs.msdn.com/bobbrum • Chris Tavares: tavaresstudios.com/Blog

  35. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related