Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division
Agenda Introduction Core Architecture Configuration Tool Application Blocks + Demo Summary
A Set of general purpose software components Developed by the Patterns & Practices (P&P) group in MS Not specific to application type or architectural style Can be extended easily Open Source Fully configurable Fully documented What Is Enterprise Library
Provides software components for: Data Access Caching Logging Exception Handling Security Cryptography Validation Policy Injection What Is Enterprise Library – Cont.
Fully modular Should be used as the base libraries of the application Became the De-Facto standard for.NET applications What Is Enterprise Library – Cont.
p&p Enterprise Library Partner blocks Customer blocks Community blocks p&p blocks Customer Y library Customer Z library
What Is Enterprise Library – Cont. Enterprise Library is… A library of application blocks which solve common challenges A set of helper classes which work in any architectural style Architectural guidance embodied in code which ships with full source allowing you to modify and extend Available as a free download Enterprise Library is not… A part of the.NET Framework An application framework that imposes an architectural style A Microsoft product with support, compatibility and localization For sale
Typical applications contain common tasks Data Access Caching Logging You get the point… Instead of writing again and again the components for those tasks… Use prebuilt, debugged, tested and configurable components The Need For Enterprise Library
Often the common tasks should be customized Enterprise Library can be extended easily The source code is fully accessible Great for an application starting point The Need For Enterprise Library – Cont.
The P&P (Patterns and Practices) group was founded at 2002 It started to release guides for many development-oriented tasks: Capacity Planning Performance Tuning UI Implementation And more… History Of Enterprise Library
First Application Blocks released: Data Access Application Block Caching Application Block And more… On January 2005 Enterprise Library 1.0 was released Contained all the application blocks in one, modular package On June 2005 version 1.1 was out Some minor maintenance fixes History Of Enterprise Library – Cont.
Version 1.x targeted.NET v1.1 Contained the following Application Blocks: Caching Configuration Cryptography Data Access Exception Handling Logging and Instrumentation Security History Of Enterprise Library – Cont.
One of the purposes of P&P group was to “Bridge the Gap” between methodology and the.NET Framework Many components of the Enterprise Library has become part of the.NET Framework P&P is now part of the Dev Division in MS History Of Enterprise Library – Cont.
Version 2.0, targeted for.NET 2.0, released in January 2006 Configuration Block removed Security Block is much thinner Version 3.0, targeted for.NET 3.0, released in April 2007 … followed by v3.1 in May 2007 New Validation Block New Policy Injection Block History Of Enterprise Library – Cont.
Goals of Enterprise Library 3.0 Address top feedback received for existing application blocks Provide new application blocks to support additional development challenges Support integration with relevant features of.NET Framework 3.0 Improve the experience around key development activities Simplify the development of new application blocks and extensions Retain compatibility with Enterprise Library 2.0
Enterprise Library contains software components for the various tasks Each component is called Application Block (AB) Each AB is: Stand alone Configurable Extendable Can be integrated with other, relevant, AB’s Application Blocks Concept
Agenda Introduction Core Architecture Configuration Tool Application Blocks + Demo Summary
Core Architecture CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation
Every Application Block uses the Core services And only them There is no other dependency an Application Block must use Some Application Blocks can optionally use other Application Blocks Core Architecture
Core Services provides services for: Configuration Instrumentation Object Builder Core Architecture
Every Application Block can be configured Configuration Information can be stored in XML files or other configuration source Application Blocks can function without configuration file Configuration can be set per environment Configuration Console can be used to manage the configuration information From within Visual Studio or as an external program Core Architecture - Configuration
Every Application Block can be instrumented using: Event Log events Performance Counters WMI Events Very helpful in debugging and testing the code Turned Off by default Instrumentation code can be reused by external components Core Architecture – Instrumentation
Responsible for building objects inside Application Blocks Uses object factory to instantiate the object Executes Strategies on the object as it is instantiated / destructed Can be used as a “Smart” singleton Leveraged heavily by the Policy Injection Application Block Core Architecture – Object Builder
Agenda Introduction Core Architecture Configuration Tool Application Blocks + Demo Summary
Tool for managing the configuration files of the various Application Blocks Integrated into Visual Studio, or can be launched as external program Provides easy and intuitive UI Can be used easily by non-programmers Configuration Tool
Agenda Introduction Core Architecture Configuration Tool Application Blocks + Demo Summary
Provides a simple, intuitive model for logging events Uses System.Diagnostics classes Extremely configurable: What will be logged Where will it be logged How will it be formatted And more… Logging Application Block
Logs can be sent to: Event Log Database MSMQ Text File WMI Event Custom Locations Logging Application Block
Logging AB + Configuration Demo
Answers an ancient question: What to do when an exception is thrown? Provides external mechanism to handle exception Sets policies for specific exception type Wrap the exception Replace the exception Log the exception And more… Exception Handling Application Block
Demo
Helps validate values in objects and UI Enables validation in standard, structured way Validation rules can be specified In central, external configuration file Using attributes Programmatically Contains built-in rules for primitive validations Custom rules can be added easily Validation Application Block
Demo
Helps separating core business logic from cross cutting concerns in objects Such as Logging, Validation, Security etc. Provides factory for creating objects Uses interception and injection to apply policies on the object Policies can be specified declaratively or in code Can utilize other Application Blocks in the policies Policy Injection Application Block
Demo
Helps creating: New Application Blocks for use within the Enterprise Library New providers for existing Application Blocks Contains Architectural Overviews, How-To Topics and Automated Guidance Packages Produces full blown AB, aligned with the best practices of the P&P team Application Block Software Factory
Demo
Agenda Introduction Core Architecture Configuration Tool Application Blocks + Demo Summary
Enterprise Library can take care of the routine tasks almost every app faces Implements current best practices of software development Extremely configurable Extremely extendable Is here to stay Summary
Download Enterprise Library f79-daf2-43af-9897-d926f03b9e60&displaylang=en Enterprise Library Site Patterns & Practices Team Guy Burstein’s Blog:
Questions?
Thanks!