About the Enterprise Library 3.1 - May 2007 Release

 

About the Enterprise Library 3.1 – May 2007 Release

patterns & practices Developer Center

Enterprise Library

patterns & practices Developer Center

Microsoft Corporation

May 2007

Summary

The Enterprise Library 3.1 release includes all improvements from the earlier Enterprise Library 3.0 – April 2007 release in addition to minor changes and fixes to the Data Access Application Block, the Policy Injection Application Block, and the Validation Application Block. Most notably, the default Remoting Policy Injector can now be replaced with alternative interception mechanisms without modifying the application block code.

Both the Enterprise Library 3.0 release and the Enterprise Library 3.1 release include two new application blocks (the Validation Application Block and the Policy Injection Application Block), two guidance packages, and a configuration editor that is integrated with Visual Studio.

Contents

Changes In Enterprise Library 3.1

Changes in Enterprise Library 3.0

Migrating from Earlier Releases

Changes in Enterprise Library 3.1

Enterprise Library 3.1 – May 2007 contains only minor changes and fixes from the earlier Enterprise Library 3.0 – April 2007 release. The following sections describe the most significant changes.

Data Access Application Block

Connection strings for OLEDB and ODBC connections in the May 2007 release of the Data Access Application Block can now be edited using custom dialog boxes from the configuration tools.

Policy Injection Application Block

The May 2007 release of the Policy Injection Application Block includes the following improvements:

  • The default Remoting Policy Injector can now be replaced with alternative interception mechanisms through configuration without modifying the application block code.
  • Call Handler attributes are now correctly honored when they are placed on interface methods.
  • An issue that could cause duplicate handlers where matching rules matched both a class and its interface is fixed in this release.
  • Classes implementing COM interfaces (including those derived from System.Windows.Forms.Form) can now be intercepted.
  • TraceLogEntry class is now serializable; this means it can now be used with the MSMQ Trace Listener.

Validation Application Block

The May 2007 release of the Validation Application Block includes the following improvements:

  • An issue that prevented the PropertyComparisonValidator from working with the Windows Forms integration adapter is fixed in this release.
  • The message template for the PropertyComparisonValidator can now be saved using the configuration tools.

Changes in Enterprise Library 3.0

This release of Enterprise Library includes two new application blocks (the Validation Application Block and the Policy Injection Application Block), two guidance packages, and a configuration editor that is integrated with Visual Studio. There are also additions in functionality to the Data Access Application Block and to the Logging Application Block. The following sections discuss these and other changes in this release.

Changes That Affect All Application Blocks

The changes to the Enterprise Library that affect all the application blocks are the following:

  • This version of Enterprise Library includes pre-compiled strong-named assemblies for all the source code.
  • A separate Microsoft Windows Installer (.msi file) now provides the source code for Enterprise Library. This Windows Installer is installed by the main .msi file. You can use the source code .msi file to extract a copy of the source code and place it in a file location that you can specify as many times as you want.
  • The partial trust patch 2554 for Enterprise Library – January 2006 is incorporated into the Enterprise Library core.
  • The manageability extensions for Enterprise Library – January 2006 is incorporated into the Enterprise Library core.
  • You can now use Visual Studio to create and modify configuration files. This configuration tool is named the Configuration Editor. The Configuration Editor has the same functionality as the stand-alone Configuration Console, but it uses the Visual Studio Properties window to display an application block's properties and uses the errors list to display configuration errors. Collectively, the Configuration Editor and the stand-alone Configuration Console are referred to as configuration tools. The following describes some of the activities the configuration tools help you with:
    • You can now use the configuration tools to create and modify standard .NET Framework <appSettings> sections.
    • You can now use the configuration tools to tailor an application block's configuration to a particular run-time environment.
  • You can now use the configuration tools to encrypt and decrypt the data contained in configuration sections.

Changes to Individual Application Blocks

The significant changes to the individual application blocks are described in the following sections. They discuss changes to the Data Access Application Block, the Exception Handling Application Block, and the Logging Application Block.

Data Access Application Block

The April 2007 release of the Data Access Application Block includes the following improvements:

  • It includes a new class named SqlCeDatabase that allows you to use SQL Server Compact Edition (CE). This is a lightweight, in-process version of SQL Server that includes the essential functions of a relational database.
  • It includes a new overload of the Database.UpdateDatabase method that uses the updateBatchSize parameter. Setting the UpdateBatchSize parameter to a positive integer value causes the DataAdapter object to send updates to the database as batches of the specified size. This reduces the number of database round trips.

Exception Handling Application Block

The April 2007 release of the Exception Handling Application Block includes the following improvements:

  • The Exception Handling Application Block can be used to implement exception shielding at the service interface of a Windows Communication Foundation (WCF) application. The ExceptionShieldingAttribute can be defined on a service implementation class to invoke an exception policy at the service boundary. The FaultContractExceptionHandler can be used to map exceptions to fault contracts and to prevent sensitive information from being returned to untrusted callers.
  • The ExceptionPolicy.HandleException method includes a new overload that calls the exception policy and returns the resulting exception in an out parameter instead of throwing the resulting exception.
  • The Wrap and Replace exception handlers include additional configuration properties that allow you to specify exception messages in external resources instead of directly in the configuration file. This capability can be used to support localization of exception messages.

Logging Application Block

The April 2007 release of the Logging Application Block includes the following improvements:

  • It includes a Rolling Flat File Trace Listener. This trace listener creates a new log file when the current log file exceeds a predefined time or size limit.
  • It includes a WCF adapter that allows you to you to log WCF messages.
  • It includes an enhanced version of the TimeStampToken class. Earlier releases of the Logging Application Block allowed only timestamps to be logged in Coordinated Universal Time (UTC). In this release, the timestamp token supports a local: prefix that indicates that the timestamp should be displayed in local time.
  • It includes the ReflectedPropertyToken class. This release of the Logging Application Block supports a new formatting token that allows you to log custom properties on custom classes that either derive from the LogEntry class or modify it.

Additions to the Enterprise Library

Both the Enterprise Library 3.0 release and the Enterprise Library 3.1 release include two new application blocks (the Validation Application Block and the Policy Injection Application Block), two guidance packages, and a configuration editor that is integrated with Visual Studio. The following sections describe each of these.

The Validation Application Block

The Validation Application Block allows developers to create validation rules that they can use in their applications. It provides the following benefits:

  • It provides a common approach to defining validation rules for your business objects that allows them to be reused across different layers of your application.
  • It provides a set of common validation rule types and the ability for developers to easily define their own rule types.
  • It provides technology adapters that make it easy to integrate the Validation Application Block with ASP.NET, Windows Forms, and WCF.

The Policy Injection Application Block

The Policy Injection Application Block allows developers to specify the crosscutting behavior of objects in terms of a set of policies. Crosscutting concerns are the necessary tasks, features, or processes that are common across different objects. Examples are logging, authorization, validation, and instrumentation. A policy is the combination of a series of handlers that execute when client code calls methods of the class and—with the exception of attribute-based policies—a series of matching rules that select the classes and class members (methods and properties) to which the application block attaches the handlers. The purpose of the Policy Injection Application Block is to help separate the core and crosscutting concerns, and to minimize potential issues associated with implementing common features.

The Policy Injection Application Block provides a ready-built solution that is easy to implement in new and existing applications, and in particular in applications that already take advantage of the features of the Enterprise Library. It ships with pre-built handlers for these application blocks to speed up development when using the Enterprise Library, while helping to manage crosscutting concerns. Developers can also create custom handlers and policies that carry out almost any required interception processing for methods and properties of their objects.

The Strong-Naming Guidance Package

This release of the Enterprise Library includes a new strong-naming guidance package that is integrated with Visual Studio. It automates the process of strong-naming collections of projects and it also modifies any [InternalsVisibleTo] attributes to include a public key.

The Application Block Software Factory

The Application Block Software Factory provides automated and written guidance that simplifies the process of building custom application blocks and application block provider classes. The Application Block Software Factory includes guidance automation recipes for a variety of tasks, such as the following:

  • Creating a new application block
  • Creating a new provider library
  • Creating a new typed or untyped provider for the Enterprise Library application blocks
  • Creating a new typed or untyped provider (generic)
  • Converting an untyped provider to a typed provider
  • Creating a new provider factory and base class
  • Creating a new design-time provider base node
  • Creating a provider design-time node

Migrating from Earlier Releases

In general, applications built using Enterprise Library for .NET Framework 2.0 – January 2006 will function with the Enterprise Library 3.0 or the Enterprise Library 3.1 without the need for any code changes. It will be necessary to update the references to refer to the new assemblies and to update the configuration files to reference the correct version of the assemblies.

Note: If you already have the Enterprise Library 3.0 installed, you must uninstall it before installing the Enterprise Library 3.1. However, you can install the Enterprise Library 3.0 or the Enterprise Library 3.1 when 2.0 is already installed.

Refer to each application block's documentation for additional guidance about migrating from earlier releases of Enterprise Library.

Start | Previous | Next

patterns & practices Developer Center

Show: