Showing posts with label enterprise library. Show all posts
Showing posts with label enterprise library. Show all posts

Friday, May 25, 2007

Enterprise Library 3.1 - May 2007

Now is Enterprise Library 3.1 avalible for download here. You can read what news the release includes in Tom Hollanders blog here.

Wednesday, May 23, 2007

Enterprise Library 3.1

Tom Hollander describes the news in Enterprise Library 3.1 here. It's more or less a maintainance release.

Thursday, April 19, 2007

Validation Block in Enterprise Library 3.0

My first validtion block impression.

Validation Block is really interesting. This idea (in various implementations) exists in some frameworks today, but I think that most projects implements there own validation pattern. The Validation Block gives you a good pattern for the validation or actually several patterns. You can validate in code (by using attributes) or configurations file. The difference between them are that using configuration you can change the validation rules after deployment by just changing the configuration file and in code you get a better encapsulation of the rules but you must re compile the code to do a rule change. I think that if you use configuration to specify the rules you can get problems getting an overview of all validations if you got a large system. The configuration file will be large and kind of messy (the buildin tool for maintaining configuration files will help you but not enough I think).

I think this Block will be useful for most validations in an average application. Try to use Validation Block for all validation and if you must you can use another pattern for the exceptions, when the Validation Block couldn’t help you. You can write you own validator classes and then use them as the build in validators.

I haven’t been able to write more complex validation rules yet I just spend some hours writing a test app to get a first opinion of this. First of all I think you should select one pattern for the validations. Don’t mix the specification of the validation rules in both configuration file and in code. If you mix this two you will get a cheezy mix of validation logic that will be hard to maintain.

Positive

  • This is a good pattern for validations.
  • Good to separate the validation code with business logic.
  • Easy to use.

Negative

  • It is more difficult to debug and track errors when using the Validation Block. I already got some problems when I didn’t get one rule to work. After a while it started to work without any changes made. Strange.

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.

Monday, March 26, 2007

Policy injection Application Block

In the Enterprice Library 3.0 there are a new application block, Policy Injection Appliction Block (PIAB). This is very cool. Now you can write policies in your config file.

As David Hayden explains it "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."

Read more about it in David Hayden's blog and in Tom Hollander's blog.

Sunday, March 25, 2007

Validation Application Block - Enterprise Library 3.0

The new validation application block in enterprise library 3.0 could be really cool. Check out David Haydens short presentation. There are a short presentation of Visual Studio Integrated Configuration Editor Support as well. It will be interesting to follow this in the future. A february 2007 ctp of ent lib 3.0 is avalible here. It seems that the RTM will be released in early april.

The next release of the web client software factory will include support for the validation block.