Friday, April 13, 2007

New features in ent lib 3.0

Here comes a little information about the new application blocks in enterprisce library 3.0. Watch a webcast here (MSDN Webcast: New Capabilities in Enterprise Library 3.0 (Level 300)).

Validation Block
The validation block has integration with WinForms, ASP.NET and WCF. The developer team wanted to get integration with WPF as well but there was no time to finish that one. I hope it will come a new version with that functionallity soon.

This block meens you can validate the data with the same validation both in the UI and in the service boundaries. Really cool.

For the UI you can associate a control with the validation rule for a specific type or member. In WCF the validation rules are defined within the contracts (data or service).

Policy Injection Application Block
The purpose of this block is to help up productivity in the projects by seperating the cross-cuttings concerns like security, validation, performance monitoring, caching, authorization, logging) from business logic.

For example if you want to add logging to all objects in a layer. Use the logging handler that is included in the block. Then add a rule like "All objects with this namespace". When you create the object you will use a API instead of the new operator. The object is now wrapped in an interception layer. The interception will look in the configuration file and see that "oh... this object is in the selected layer" and calls the handler for the logging.

The policy could be modified after deployment. If you for example will get some performance truble you can change the policy.

Handlers included in the enterprise library 3.0
  • Validation Handler
  • Logging Handler
  • Authorization Handler
  • Exception Handling Handler
  • Caching Handler. If the method has recently been called, return the cached value.
  • Performance Counter Handler. You can see for example, number of times a method is called, average call duration, number of exceptions.

Example Of New features in ent lib 3.0
Data Access Block

  • Support for SQL Server 2005 Compact Edition-
  • TransactionScope doesn't understand that that multiple updates is to the same database. The transaction escalated to become a DTC transaction and the transaction become much more expensive then it should be. The block now recognise if the TransactionScope is active and then prevents the escalation to become a DTC transaction.
  • Batch updates now are avalible in the block not only in .NET.

Logging BLock

  • Rolling flat file. Creates a new file based on the file size or date and time.

Visual Studio Configuration Tool

  • A new tool in Visual Studio in which you can edit the config files within the IDE.

Automation Block Factory

  • A new software factory for building your own application blocks and you can use this factory if you want to create extensions to existing application blocks.

This new version of application blocks is 100% API compatible with the 2.0 application block. You can have multiple versions of Enterprise Libary installed on the same machine but you cannot use the toghether in the same application.

No comments: