April 2010 is just jammed packed with Microsoft releasing products to maintenance (RTM) and joining the ranks of SharePoint 2010, Office 2010, Visual Studio .NET 2010 is the Enterprise Library 5.0. While it has been a number of years since I last used this library I am beginning to think that I need to revisit this product. I recall years back that I was please with earlier version and I can now only imagine how far this library has progressed and how much time it can save me.
Microsoft Enterprise Library 5.0 contains the following application blocks:
- Caching Application Block: Developers can use this application block to incorporate a cache in their applications. Pluggable cache providers and persistent backing stores are supported.
- Cryptography Application Block: Developers can use this application block to incorporate hashing and symmetric encryption in their applications.
- Data Access Application Block: Developers can use this application block to incorporate standard database functionality in their applications, including both synchronous and asynchronous data access and returning data in a range of formats.
- Exception Handling Application Block: Developers and policy makers can use this application block to create a consistent strategy for processing exceptions that occur throughout the architectural layers of enterprise applications.
- Logging Application Block: Developers can use this application block to include logging functionality for a wide range of logging targets in their applications. This release further improves logging performance.
- Policy Injection Application Block: Powered by the Interception mechanism built in Unity, this application block can be used to implement interception policies to streamline the implementation of common features, such as logging, caching, exception handling, and validation, across a system.
- Security Application Block: Developers can use this application block to incorporate authorization and security caching functionality in their applications.
- Unity Application Block: Developers can use this application block as a lightweight and extensible dependency injection container with support for constructor, property, and method call injection, as well as instance and type interception.
- Validation Application Block: Developers can use this application block to create validation rules for business objects that can be used across different layers of their applications.
I went back to code that I had archived from years back to revisit the Data Access Block. Consider the following examples:
private void btnUseDataReader_Click(object sender, System.EventArgs e)
{
Database db = DatabaseFactory.CreateDatabase();
IDataReader reader = db.ExecuteReader(CommandType.Text, "SELECT TOP 10 * FROM Products ORDER BY ProductName");
dgProducts.DataSource = reader;
dgProducts.DataBind();
}
private void btnUseDataSet_Click(object sender, System.EventArgs e)
{
Database db = DatabaseFactory.CreateDatabase();
DataSet ds = db.ExecuteDataSet(db.GetSqlStringCommandWrapper("SELECT TOP 10 * FROM Products ORDER BY ProductName"));
dgProducts.DataSource = ds;
dgProducts.DataBind();
}
private void categories_SelectedIndexChanged(object sender, System.EventArgs e)
{
dgSalesByCategory.DataSource = DatabaseFactory.CreateDatabase().ExecuteReader("SalesByCategory", categories.SelectedValue, "1998");
dgSalesByCategory.DataBind();
}
A cool feature of 5.0 is the Enterprise Library Configuration Application Block Console which is the graphical interface to the library. This user interface is both user friendly as far as use and provides a quick look a the various blocks in terms as how they are used.
Upon revisiting the example above my question to you is this? Do you utilize the Enterprise Library on a daily basis? If so, in your own words how much time do you feel it saves during the development phase versus writing your own code?










Recent Comments