Friday, March 30, 2007

Excuses

Here I am over a month into my blogging experience and I'm already slacking off. I still owe a few colleagues an article on using XsdObjectGen with the XmlSerializer and the common problems that arise with non-trivial schemas.

Work is just consuming all my time but I promise to get new posts up soon!

Thursday, March 15, 2007

Busy, busy, busy...

I know I promised to post a couple times a week but the new project at work is consuming huge amounts of time on the front end. I've spent the last 3 days in the bowels of the System.Xml.Serialization.XmlSerializer and an object model that I "auto-generated" with XsdObjectGen.

The whole XmlSerializer ordeal has provided me with enough information for another post but it will be a few days before I can get that edited and put up for all to see.

On a positive note, I got email from Brian Button and I might be able to get some great help on the ENTLIB part of my work project.

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?