Friday, March 2, 2007

Microsoft Enterprise Library

(This post is a work in progress... I just needed to get an answer up quickly for several friends.)

Finally, something of moderate substance.

At work, I am actively promoting the Microsoft Enterprise Library (ENTLIB) for the project I am currently working on. I've now been asked, "What is the ENTLIB?", enough times that I decided to answer that question here as it's not a "quick answer". If the link I've provided is too much, here's my attempt at a simple description.
The Microsoft Enterprise Library is a pool of source code written by Microsoft and made freely available to developers. The source in the ENTLIB represents the collected "best practices" recommended by Microsoft for using the .NET Framework to implement enterprise solutions.
That's the short answer most people want.

It's technically correct. It's also totally useless. It's not informative enough to really let you know what you are in for if you use the ENTLIB. So, I'll pick the description apart and explain. Examine this diagram from the ENTLIB documentation:

  • "pool of source code" - Actually, several pools logically organized into Application Blocks in ENTLIB terminology. The application blocks that are part of the ENTLIB are depicted in the diagram.
  • "written by Microsoft" - While this may not mean anything to you, it is significant to me. These guys probably have more development expertise in .NET than I do. I know they have more development budget than I do and probably anyone I'm ever going to work for.
  • "freely available" - Yes, Virginia, Microsoft does engage in open-source development.
  • "best practices" - Unknown to many developers, Microsoft tracks good work and tries to capture best of breed projects and implementations. Many of these best practices' artifacts are freely available at the Microsoft patterns & practices Development Center website.

But just getting started can be daunting! Where do you start the learning process? I'm not an ENTLIB expert but have formed an opinion on where to start.

  1. Understand the ENTLIB configuration system. I can't over stress the importance of configuration and meta-configuration data in the ENTLIB. This used to be an application block prior to the .NET 2.0 Framework release. The System.Configuration namespace now subsumes much of what was previously in the ENTLIB configuration application block. Many books and articles still refer to this core system as an application block.
  2. Understand the ENTLIB configuration system - Damn it!
  3. Understand the object injection model. The "core contains the ObjectBuilder", this is a configurable (everything in ENTLIB is configurable - see step 1) object creation pipeline. In my opinion, you don't need to know every detail of the ObjectBuilder but an understanding of your object instantiation is essential.
  4. Finally, concentrate on the specific application block of most use to your application. Perhaps data access is most important to you, or cryptography, or logging and exception handling.

Clearly, everyone learns differently and your mileage will certainly vary. The steps I outlined just worked best for me.

Related P&P Projects

To the best of my understanding, the ObjectBuilder was actually designed and implemented during the Composite User Interface (UI) Application Block project (referred to as the CAB) . The ObjectBuilder was so useful, it was refactored into the ENTLIB.

Why is that interesting? Because the CAB is sometimes mistaken as part of the ENTLIB. It's actually a custom application block written using the ENTLIB. Since the ENTLIB and the CAB are both Microsoft projects, the refactoring of ObjectBuilder into the ENTLIB was logical.

ObjectBuilder, while shown as part of the core is actually an application block. The ENTLIB documentation notes:

ObjectBuilder is a patterns & practices Application Block, but because of its highly specific audience and its recent inception, it is not yet fully documented as a stand-alone asset like the Enterprise Library application blocks are.

The CAB seems like a perfect candidate to have that classic Visual Studio "wizardry" in order to add new CAB "thingies" (Since, this article is about the ENTLIB, the full description of the CAB is left for another time, for now, "thingies" is all I'm willing to say.). That leads us to the Smart Client Software Factory.

The Smart Client Software Factory, is a collection of code-generators, how-to examples, Guidance Automation Toolkit (or GAT), and documentation for creating "smart clients".

What's the GAT??? It's a toolkit to let software development kit (SDK) developers like me add guidance toolkits to Visual Studio using the Guidance Automation Extensions (GAX).

What the hell is the GAX?!?!??!?

It really does take a bit of commitment on your part to go learn the ENTLIB and the related projects that spring up around it. My advice is to download the ENTLIB, play with the quick starts and guidance, read the documentation, buy a book, and just dig in and write a client or your own application block. In my opinion, it's certainly worth the effort.

One last question... Who is John Galt?

4 comments:

Greg said...

Nice writeup.

So are you a fan of Atlas Shrugged?

Carey Cilyok said...

Probably more a fan of obscure references... :)

Actually, I'm a fan of objectivism.

Carey

Matthew Petty said...

I know you do your homework but might want to compare Spring .Net and ENTLIB, especially the DI container. I am going to take a closer look at ENTLIB after your write up.

FYI - I have only used ENTLIBs caching block in a few applications at work. And I am slightly bias toward Spring .Net, especially for DI, log4net integration and DAO support for data access.

Anonymous said...

Good words.