Learn Microsoft Enterprise Library

Monday, January 19, 2009

The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development cross-cutting concerns (such as logging, validation, data access, exception handling, and many others). Application blocks are a type of guidance; they are provided as source code, test cases, and documentation that can be used "as is," extended, or modified by developers to use on complex, enterprise-level line-of-business development projects.

Thursday, January 15, 2009

Policy Injection Application Block

The Policy Injection Application Block ( PIAB ) is new in this release and may change the way you use Enterprise Library and think about development in general.

If you look at the code in your applications, you will see a lot of non-business related code, such as logging, security, exception handling, validation, etc. This “infrastructure” code is very necessary, but can be very distracting and make the core business logic hard to read, understand, and find :) Wouldn't it be nice to somehow describe these infrastructure concerns across your application in the form of policies and attach handlers to those policies that carry out these infrastructure related tasks / concerns for you without you explicity coding them?! Heck yeah it would :)

Put simply, the Policy Injection Application Block can save you from having to write all those boring validation, security, exception handling, and security-related code and instead allow you to write policies in your configuration file associated with them. These policies can then be mapped to classes in your application based on matching rules. The matching rules can match a policy to an entire assembly, a namespace, types, methods, method signatures, etc.

This concept isn't new, but it sure is sweet to have the functionality in Enterprise Library

Application Blocks


The Application Blocks in Enterprise Library are designed to be as agnostic as possible to the application architecture, for example the Logging Application Block may be used equally in a web, smart client or service-oriented application. The patterns and practices team also produces more specialized Application Blocks that are not included in Enterprise Library, such as the User Interface Process Application Block, Aggregator Application Block, Updater Application Block and the Composite UI Application Block.

The patterns and practices team produces a number of other deliverables that leverage Enterprise Library Application Blocks. These include the Web Service Software Factory and Smart Client Software Factory.

Benefits


  • Improved Productivity: Each of the Application Blocks provides several interfaces meant to satisfy common application concerns.
  • Configuration Driven Design: Many technical decisions about the application behaviour can be delayed until configuration time of the application. For instance, if an application does not properly handle an exception, instead of adding another exception handler to the code, an administrator can configure an additional exception handling policy.
  • Improved Testability: Many application areas can be reconfigured to improve testing of the application in isolation.

Followers