35

Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307
Page 2: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Enterprise Library 3.1Tom HollanderSolution ArchitectSolutions Development CentreMicrosoft Australia

ARC307

Page 3: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 4: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

The Story So Far…

Application Blocks are reusable, extensible source-code components that provide guidance for common development challengesEnterprise Library is a collection of general purpose application blocks

Caching, Configuration, Cryptography, Data Access, Exception Handling, Logging, SecurityEmphasis on Consistency, Extensibility, Ease of Use and Integration

Page 5: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Goals of Enterprise Library 3.x

Address top feedback received for existing application blocksProvide new application blocks to support additional development challengesSupport integration with relevant features of .NET Framework 3.0Improve the experience around key development activitiesSimplify the development of new application blocks and extensionsRetain compatibility with Enterprise Library 2.0

Page 6: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Enterprise Library 3.x – New Features At a Glance

New application blocksValidation Application BlockPolicy Injection Application Block

Improvements to existing application blocks

Data Access Application BlockLogging Application Block

WCF IntegrationLogging, Exception Handling and Validation Application Blocks

Configuration improvements

Visual Studio-integrated configuration toolEnvironmental Overrides Manageable Configuration Source

AutomationApplication Block Software FactoryStrong Naming Guidance Package

Page 7: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Enterprise Library 3.xApplication Blocks

Caching

Security

Data Access

Logging

ExceptionHandling

Plug-inConfig

Helpers & Design

Instrumen-tation

ObjectBuilder

Cryptography

Core

Policy InjectionValidation

Page 8: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 9: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Validation Application Block Goals

Specify your validation rules onceIn configurationUsing attributesProgrammatically

Easily validate data from anywhere in your application

ProgrammaticallyIntegrated into Windows Forms, ASP.NET or WCF

Composable validation logicBuilt-in library of common primitive validation rulesCombine validation rules on type members and using Boolean logicApply multiple validation rule sets to the same types

Page 10: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Supplied Validation Rules

Validation Application Block includes the following rules:Not Null (value must not be null)

Contains Characters (e.g. does not contain any of /\?<>”:)

Regular Expression (e.g. value is a valid e-mail address)

Range (e.g. must be from 10-20 or 1/1/1950 to 12/31/1999)

Relative DateTime (e.g. birth date is more than 18 years ago)

String Length (e.g. string is at least 8 characters long)

Domain (e.g. must be one of {John, Paul, George, Ringo})

Enum Conversion (e.g. string can be converted to a value in the Color enum type)

Type Conversion (e.g. string can be converted to a DateTime)

Property Comparison (e.g. MaxDate > MinDate)

All validation rules can be negated E.g String Length must not be between 5 and 10 characters

Page 11: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Specifying Validation Rules

AttributesAttributes allow you to specify validation rules directly within the type being validatedValidation logic cannot be changed without recompilingYou must own the source code of the type

ConfigurationValidation rules are stored in XML and can be edited with the Enterprise Library configuration toolValidation logic can be changed without recompilingYou don’t need to own the source code of the type

Page 12: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Validating Data

ProgrammaticallyUsing the block’s core API

Via Integration AdaptersWindows Forms and ASP.NET

Integrated into user input controls

Windows Communication FoundationIntegrated into service interface

Page 13: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Validation Application Block

demo

Page 14: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Policy Injection Application Block Goals

Separate cross-cutting concerns from business logic

Use interception and injection to apply policies at runtimeDefine 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

Page 15: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Policy Injection Application Block

Client MyObjectProxy

Validation Applicatio

n Block

ASP.NET Cache

Logging Application Block

Valid

atio

n

Handle

r

Cach

ing

Handle

r

Loggin

g

Handle

r

MyObject obj = PolicyInjection.Create<MyObject>();int result = obj.DoStuff(123);

Exception

Validation

Failed

Found In Cache

result == 42

Page 16: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Defining Policies

Policies defined in configuration consist of a set of matching rules and the definition of the handler pipelineMatching rules are predicates that specify which members the policy should apply toHandlers can also be applied directly to types and members using attributes

Page 17: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Policy Injection Application Block

demo

Page 18: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Supplied Handlers

Validation HandlerLogging HandlerAuthorisation HandlerException Handling HandlerCaching HandlerPerformance Counter Handler

Page 19: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 20: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Data Access Application Block

SQL Server Compact Edition providerNew SqlCeDatabase class that integrates with the SQL CE managed provider

TransactionScope integrationPrevents escalation to DTC when multiple updates are made to the same database within a TransactionScope context

Batch updatesUpdateDataset now supports an updateBatchsize parameter

Page 21: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Logging Application Block

Rolling Flat File Trace ListenerAutomatically creates a new file based on file size or date/time

Improved Text FormatterReflected Property Token, to retrieve data out of custom LogEntry typesDisplay timestamps in local or UTC time

WCF IntegrationEntLibProxyTraceListener and XmlTraceListener

Page 22: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 23: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Visual Studio-integrated Configuration Tool

Edit configuration from within the IDELaunched from .config files in the Solution ExplorerCan be configured to point to different sets of assemblies

Page 24: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Environmental Overrides

Simplifies management of configuration files across multiple environmentsSeparates master configuration files from environment-specific delta filesSpecify which settings to override on a node-by-node basisMerge configuration files using the configuration tool or a command-line tool

Page 25: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Configuration Tool

demo

Page 26: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 27: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Application Block Software Factory

Streamlines building your own application blocks and extensions to existing application blocksFeatures include:

Code generation in either C# or Visual Basic .NETSolution templates for Application Blocks and Provider LibrariesRecipes to create custom providers for Enterprise Library application blocksRecipes to create new factories, provider bases and providers for your own blocksRecipes to create design-time configuration code from runtime configuration classes

Page 28: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Application Block Software Factory

Page 29: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Agenda

IntroductionNew Application Blocks

Validation Application BlockPolicy Injection Application Block

Improvements to Existing Application Blocks Configuration ImprovementsApplication Block Software Factoryfinally {

Page 30: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Migration from previous versionsEntLib 3.0/3.1 are 100% API

compatible with the previous January 2006 release of Enterprise LibraryConfiguration formats for existing blocks are unchanged, but assembly version numbers and possibly public key tokens will need to be changed2.0 and 3.x can be installed side-by-side (but not 3.0 and 3.1)Supports .NET Framework 2.0 or 3.0

WCF-specific functionality requires .NET Framework 3.0

Page 31: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Resources

Download Enterprise Library and related resources from:

http://msdn.microsoft.com/practices Join the Enterprise Library Community at:

http://codeplex.com/entlib Download or contribute to community extensions at

http://codeplex.com/entlibcontrib Read blogs from the Enterprise Library team at:

http://blogs.msdn.com/tomhollhttp://blogs.msdn.com/agile

Page 32: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Microsoft Solutions Development Centre

A fully equipped project delivery environment hosted within Microsoft AustraliaA specialist engineering facility for delivering high quality software quicklyA way of tapping into external skills and resources while using your own teamThe SDC is a unique way to reduce project risk, get the job done and pick up skillshttp://microsoft.com.au/sdc or [email protected]

Page 33: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

Evaluation Forms

Page 35: Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307

© 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.