The Enterprise Library
If you're like me when you've heard this mentioned your head spun, just a little. Then when you hear it comes from Microsoft's Patterns and Practices group, your head completes it's 360 degree rotation.
So what is it? It's a collection of application blocks. Great Ryan, thanks....what's an application block? An application block is a set of methods that encapsulate the best practices for doing a particular task. For example we all know there is about a zillion and one combinations of steps you can take to open a database, construct a query, pass that query and retrieve your data. But there are ways that are better than others. So, one of the application blocks included with the Enterprise Library is called the Data Access Application Block, which provides you a series of methods that streamline this process. I'll write a bit more on each of the Application Blocks in coming posts.
Configuration Tool
The Enterprise Library comes with the Configuration Utility that helps you manage the properties and behaviors of each application block. Like for the Data Access Application Block the utility helps you manage things like connection strings so that when you are using the Data Access Application Block methods you don't need to worry about remembering the connection string etc. The Configuration tool also let's use manage multiple sets of configuration so you could from a single place manage your development strings, testing string and production strings from one place. Even better it's integrated into Visual Studio so you don't have to switch out to make changes, I'll show this in action during the Data Access Application Block demo in the next post.
Application Blocks
Before I go on to with the next post with a walkthrough of the Data Access Application Block, I wanted to give you a break down of all the blocks that the Enterprise Library comes with and what they do.
Data Access Application Block - This block streamlines the process of all things related to data access...get records, put records etc.
Caching Application Block - This one allows you incorporate caching techniques easily.
Cryptography Application Block - This one helps you incorporate encryption methods into your application.
Exception Handling Application Block - Allows you to define consistent error handling techniques through your application.
Logging Application Block - A set of procedures to allow you to quickly and easily implement standarized logging routines into you application.
Security Application Block - Use this to incorporate security and security caching into your application. (I took that almost directly from the documentation because I've never looked at it and I currently don't see what it gives you that the Membership Provider doesn't. I'll do a write up on this one eventualy.)
Validation Application Block - This is a business object one. With this you can incorporate a standardized set of rules checking much like in Rocky Lhotka's CSLA
Policy Injection Application Block - This one I know almost nothing about so I'll cut and paste the description from the documentation: "Developers can use this application block to implement interception policies that can be used to streamline the implementation of common features, such as logging, caching, exception handling, and validation, across an application." (This one will definately be examined closer in future posts.)
Conclusion
The Enterprise Library WILL make your life easier once you embrace and grasps it's concepts. This week I will be writing an article with a quick "how-to" on the Data Access Application Block, and then I will be following that up with a write up on the Logging Application Block. As always if you want to see anything in these articles drop me a line at ryan@file-new.com.