Application Block Software Factory - Created My First Application Block

Application Block Software Factory - Created My First Application Block

by David Hayden ( Microsoft MVP C# ), Filed: Enterprise Library 3.0

 

In case you were not aware, Enterprise Library 3.0 ships with a software factory, called the Application Block Software Factory. As the name implies, the Application Block Software Factory will help you create application blocks that integrate with Enterprise Library.

I created my first Application Block during the past 2 evenings, and as you would expect, the first time is always the hardest :) It also doesn't help that the current version has errors ( as you would expect from a CTP ), and the documentation is pretty light, although indeed helpful. In the end, however, I have a pretty cool application block, albeit a little light on the functionality. The design time experience and runtime experience are complete, I just need to add additional functionality to the providers to make it a bit more useful. More on that later.

Enterprise Library 3.0 runs fine on the .NET 2.0 Framework, unless you want to use the Application Block Software Factory. In that case, you will also need to install the Guidance Automation Extensions and the Microsoft .NET 3.0 Framework. If you want to be able to modify the Application Block Software Factory, you will also need to install the Guidance Automation Toolkit.

Developing the runtime part of the application blocks is a breeze. Writing a provider that performs certain functionality is the easy part compared to figuring out the design-time integration with the Enterprise Library Configuration Tool. If you just have simple properties, like string, int, etc. all is pretty easy and the factory helps you serilialize and deserialize properties to the IConfigurationSource as well as display those values.

In my case, however, I wanted to leverage another section in the configuration file - connectionStrings section, allowing one to choose a connection string name from a dropdown based on connection string in the current configuration file. There are no instructions on how to do that :) I was looking through source code over and over and debugging like mad to get that to work. All-in-all it was time consuming as heck, but you never learn more than when you have to figure it out the hard way.

I was thinking about doing a bunch of tutorials on the Application Block Software Factory, but 1) it is probably a bit early and would be better done when it goes into production and gets in its final form, and 2) the topic is a bit complex.

I plan on playing with the Application Block Software Factory quite a bit over the next month, so I hope to find some digestible chunks I can talk about on the blog to help out those who may be interested in the software factory but not sure where to start.

Source:  David Hayden ( Microsoft MVP C# )

Filed: Enterprise Library 3.0

posted on Thursday, January 04, 2007 8:53 PM

Main

News

Green Tea

.NET Development

Enterprise Library

Patterns & Practices