Simple Web Application Block Gets StructureMap and Windsor Dependency Injection Integration

Simple Web Application Block Gets StructureMap and Windsor Dependency Injection Integration

by David Hayden ( Florida .NET Developer )

 

PnPGuidance is a testing ground for my Simple Web Application Block and soon my ActiveRecord Framework. As I mentioned before, I created a Simple Web Application Block for applications where I don't need the Composite Web Application Block in the Web Client Software Factory. Of course, as it turns out, I think I will use the Simple Web Application Blocks for all my projects as it gets the job done quite nicely and I can enhance it very, very quickly.

Today I added integration for StructureMap and Windsor as optional dependency injection tools. Yep. Dependency Injection is a pluggable service as you would expect as opposed to being forced to use a particular tool, like ObjectBuilder. It comes with a simple dependency injection mechanism that I made ( good for Partial Trust ), but the default provider is not even close to being as functional as StructureMap and Windsor. However, it will get the job done when needs are simple.

So, right now the PnPGuidance Solution looks like this:

 

 

Only one module is activated on the PnPGuidance Website and that is the Blogs Module. I have nothing to sell on PnPGuidance and already spend way too much time in other forums, so I don't think I will be adding the Commerce and Forum Modules :) They are mainly in the project to test out the module discovery feature.

Speaking of discovery, Ayende gave me the idea of scanning modules for Controller and Presenter Classes when he mentioned the BijectionFacility in Igloo. So, I went ahead and ran with that idea and now automatically add Presenter and Controller Classes in a dependency injection container during startup. I can, of course, add services in a module initializer class just like the CWAB, but I also use the rich configuration file support from StructureMap and Windsor. WCSF v1.1 does not allow you to register services in a configuration file which is bad IMHO.

During the next couple of weeks I will add a logging service that is pluggable and add perhaps a log4net plug-in. I then need to see how I can get my ActiveRecord Framework in there. That might be awhile as I am using a number of stored procedures for those business modules to help boost performance where it makes sense. Yes, that's right - stored procedures :)

Source: David Hayden ( Florida .NET Developer )

posted on Wednesday, July 04, 2007 9:58 PM

My Links

Post Categories

Article Categories

Archives

Loose-Leaf Tea