Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Enterprise Library 5.0

Similar presentations


Presentation on theme: "Microsoft Enterprise Library 5.0"— Presentation transcript:

1 Microsoft Enterprise Library 5.0
Welcome to Bob Brumfield’s talk on Microsoft Enterprise Library 5.0 @ NT konferenca 2011 Please wait while the Setup Wizard prepares to guide you through the presentation

2

3 Context Reusable components are important
Address common enterprise development challenges consistently across applications Application Blocks are a form factor for reusable components Reusable, testable, extensible and modifiable source code + docs, hands-on labs Enterprise Library is a set of general purpose application blocks Not specific to any one application type or architectural style Can be used as-is or as a starting point for your own libraries or frameworks WHEN IT COMES TO CODE WRITING, LESS IS MORE! YOU SIMPLY CANNOT AFFORD NOT TO REUSE!

4 Enterprise Library – Big Picture

5 EntLib Design Goals Consistency Extensibility Ease of use Integration
Blocks are written with and used in common patterns Extensibility Pluggable extension points Ease of use Config tool, tons of docs, simple interfaces, labs, webcasts Integration Work well together or separately

6 Simplification inside and out
Key themes Ease of use Learnability Less intrusive Better testability Simplification inside and out

7 No new blocks Healthy code

8 Where were we?

9 EntLib 4.x Core Plug-in Client App Unity DI Unity Extensions
Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder2 Cryptography Core Policy Injection Validation

10 Where are we going?

11 Conceptual Architecture
Functional blocks Wiring blocks

12 Enterprise Library – Conceptual Architecture
Functional blocks Common Infrastructure Config Instrumen- tation Data Access Logging Caching Exception Handling Structural/wiring blocks Cryptography Security Unity Policy Injection Validation

13 A-la carte approach You only need to use features relevant to you!

14 .NET 4.0 / VS 2010 Binaries Source Config tool Signed
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)

15 Adding logging to your app in ~3 mins!
Ease of use! Demo Adding logging to your app in ~3 mins!

16 Getting Enterprise Library objects

17 Config Experience New config tool IntelliSense in XML editor
Programmatic config support New configuration sources

18 Config Tool Stories Usability: Improve intuitiveness & learnability
Simplicity: Reduce the number of design time assemblies Extensibility: Simplify the way config for custom handlers/providers/blocks can be plugged into the config tool

19 Config Tool Experience Demo

20 Twelve Architecture & Usage of EntLib

21 Fluent Configuration Interface
Motivation: Customer requested a better way to configure EntLib programmatically Make our own test cases more readable Ref: Martin Fowler, Eric Evans.

22 Programmatic Config Experience Demo

23 Hierarchical / Redirected config
Use a non-default config store Split config into multiple physical files Combine them at runtime Allows master + override style of config Runtime version of environmental overrides

24 Logging Block 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

25 Higher Performing Logging – Preliminary Results
Formatter responsible for ~50% of the execution time Improvements N=1M 45% local improvement upto 20% global improvement 53% local improvement

26 New in Data Access Application Block

27 Processing Results Data Access 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?

28 Introducing Data Accessors
Basic idea: Instead of operating on data readers and data records that you get from a query, get back an IEnumerable<T> Now we can do LINQ to Objects magic Accessors provide a higher level abstraction that combines the command, input mapping, output mapping, and result set management into a single object. Note: Accessors are easily injectable

29 Data Accessors

30 before after

31 DAAB Accessors Demo 9/12/2018 8:07 PM
© 2007 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.

32 DAAB Accessors != ORM

33 Async DAAB Database API addition
Follows classic Begin/End async pattern NonQuery Scalar Reader XmlReader (SQL Server only) Not supported on all databases

34 Async Data Access var db =
EnterpriseLibraryContainer.Current.GetInstance<Database>(); if(db.SupportsAsync) { db.BeginExecuteScalar("Get Top Ten Products", CompletionMethod); } public void CompletionMethod(IAsyncResult async) { int count = (int)db.EndExecuteScalar(async); ...

35 Policy Injection Application Block Goals
Separate cross-cutting concerns from business logic Use interception and injection to apply policies at runtime Provide a declarative way of specifying which policies are applied where Define policies using configuration or attributes Leverage other application blocks to implement common cross-cutting concerns Validation, Logging, Authorization, Exception Handling, Caching, Performance Counters Provide flexibility in interception mechanisms Aspect-Oriented Programming (AOP )

36 Interception

37 Interceptors

38 Interceptors – Pros & Cons

39 Power of Interception Demo
9/12/2018 8:07 PM Power of Interception Demo © 2007 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.

40 Learnability With contributions by Nicolas Botto, Bob Brumfield, Grigori Melnik, Erik Renaud, Fernando Simonazzi, Chris Tavares

41 Key Takeaways Reuse for the win! Improving user experience
9/12/2018 Key Takeaways Reuse for the win! Improving user experience Simpler, more consistent code base Simpler to configure and use Better support for DI-style of development Focus on testability and maintainability Engage with us! © 2008 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.

42 Call for Action New to EntLib: Seasoned EntLib user:
9/12/2018 Call for Action New to EntLib: Start with reading the Dev Guide Download Hands-on labs (5.0) Play! Seasoned EntLib user: Evaluate v5.0 Read Migration guide Experiment with migration Provide feedback! Tell your story © 2008 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.

43 Resources Released Enterprise Library and related resources:
msdn.microsoft.com/entlib Discussions, learning resources and support: entlib.codeplex.com unity.codeplex.com Enterprise Library Community Extensions: entlibcontrib.codeplex.com patterns & practices dev center msdn.microsoft.com/practices contacts blogs.msdn.com/agile @gmelnik blogs.msdn.com/bobbrum @bobbrum

44 Hvala!


Download ppt "Microsoft Enterprise Library 5.0"

Similar presentations


Ads by Google