Enterprise Library - A FREE Resource From Microsoft
If you haven't checked out Microsoft's Enterprise Library yet, you have a real treat in store for you. Bottom line, it's the best thing since .NET itself.
"Pretty bold statement!" (I hear you saying.)
Yes, it is. But check out my evidence.
Bottom line, what is .NET? One way to describe it is to say that it's a software library that you can use to do things in your code faster and better than you could ever do on your own.
Of course, .NET implements the really base fundamentals like type definitions and string operations. But it also implements things that just make programming faster and better like System.Math.Round and System.TimeZone that you probably could write if you had to.
Microsoft's Enterprise Library is like a big extension of .NET that gives you tested, reliable, "enterprise grade" code for a whole bunch of things that you could write; and may already are. But you can use this code much like .NET itself. Actually, software like Excel, Word and many others (including third party software like Oracle and Adobe) give you a similar expansion of capabilities with their own code libraries. But these libraries only do things that relate to Excel, Word, and so forth. For example, if you want to calculate values in a spreadsheet cell, the the Excel library is what you need. The Enterprise Library goes way beyond that and gives you software that does globally useful things.
"What things?" I'm so glad you asked.
The current version (5.0 - So you know that this is a mature product, and not something somebody dreamed up yesterday.) has seven "functional application blocks". Here's what you get:
-> Data Access
-> Logging
-> Caching
-> Exception Handling
-> Cryptography
-> Security
-> Validation
You even get libraries and an architecture that lets you extend Microsoft's code with your own code blocks.
In .NET object library terminology, you might think of the functional code blocks as being a little like namespaces. .NET has a Microsoft.VisualBasic namespace that contains objects you can use to code VB.NET statements. The Enterprise Library has a "Logging functional application block" that you can use to code statements that perform logging.
"Why not just use a .NET Logging namespace?" I hear you asking.
Actually, it's the same reason that you use VB.NET instead of assembler. The term of art is that the Enterprise Library is a "higher level of abstraction". Simply put, a higher level of abstraction hides the details and lets you focus on the main problem. Instead of coding calls to System.Diagnostics.EventLog (and other namespaces), you code to Microsoft.Practices.EnterpriseLibrary.Logging.
You could argue that it's not any easier to do it this new way. (People have been making that argument about .NET itself now for ten years.) If your application is simple enough, that could be true. All I can say is, give it a try. It's free, and you can always go back.
The people who might wonder if they're taking a step up are probably not working on systems with real "enterprise class" complexity. As the level of complexity in your system goes up, problems implementing fundamental functions like the ones covered by EntLib goes up exponentially. EntLib is architected by Microsoft to not "run out of gas" when the going gets tough.
The Enterprise Library is also focused on something that becomes a really big problem in these big complex systems. They call it "crosscutting concerns". A crosscutting concern is a piece of code that is very similar when it is used over and over throughout your program. The Enterprise Library has provided what Microsoft thinks is the best and most flexible way to write that code, so it only has to be added in one place.
Enterprise Library will put few roadblocks in your path to enterprise development. You can use it with Windows Forms, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), ASP.NET, Silverlight, and console-based applications. That's crosscutting!
Version 5.0 of the Enterprise Library is a giant step up because you not only get the libraries that you can reference in your code, you also get support software that makes the process of configuring it a lot easier than it used to be. Here's a comparison of the Enterprise Library configuration utility compared with the way you would have to do it otherwise.
--------
Click Here to display the illustration
--------
Source...