Welcome to MSDN Blogs Sign in | Join | Help

Converting the Composite Web Application Block to Unity - Intro

A few weeks ago, I decided I needed to play with the Unity Dependency Injection container. I wanted to see how Chris and the rest of the team had designed it and see how usable the container was. I had seen requests on the Web Client Software Factory project's CodePlex site asking for a Unity version of WCSF. Put the two together, and I have a side project, a proof of concept I can legitimately do at work. My eventual end goal is to have the Order Management RI working with a new, Unity-based version of CWAB.

So, I sat down a few Saturdays ago, with CWAB, an early drop of Unity, and started working. After about eight hours I had the basics of CWAB working: there was a container, and a module loader, global services, and module level services. About 3 hours was used figuring out Unity, the differences between it and the container we created for CWAB (CompositionContainer) , and how to get around them. The rest was work, finding bugs in Unity (I filed a few the next day), and quite a lot of fun.

Since then, I have added a few more features, made some forwards progress, and lost ground after being overly optimistic about the impact of a few changes.

Now that I have learned a bit, I wanted to share the information with folks who might be interested in doing this themselves. Rather than trying to remember what I did the first time around, I am going to start over, take a different approach, document what I do as I go, and make a few posts out of this.

Please keep in mind, none of this is tested.  Use at your own risk.  No Support Available.  Danger, Will Robinson!  Danger!

This is a proof of concept that I am fairly certain will work, but I am not 100% certain. We will find out as we go. Oh, and I guarantee that there will be breaking changes.

My strategy will be to take the existing CWAB DLL and its unit tests, refactor the container behind an interface, modify the interface to nearly match Unity, and then drop Unity in replacing one implementation of the interface with another. After I get CWAB building and the unit tests passing with Unity, I will open up the code for the RI, replace references, and get it to work.

I will do all of this in an example-driven test driven manner. I am sure I will cheat on occasion, but I will try to be honest and point it out when I do, as well as a reason why.

EDIT: Based upon feedback, I am making the source code available at CWAB and Unity.

Published Friday, April 04, 2008 1:19 PM by mpuleio

Comments

# Converting the Composite Web Application Block to Unity - Adding an ICompositionContainer

This is the second post in a series. The initial post is Converting the Composite Web Application Block

Friday, April 04, 2008 5:17 PM by Espresso Fueled Agile Development

# Composite Web Application Block on Unity

Mike Puleio recently posted blog entries on how to convert Composite Web Application Block (CWAB) to

# Converting Composite Web Application Block to Unity - WCSF

Michael Puleio is writing a series of articles on converting the CWAB in WCSF to Unity. I have a Simple Web Application Block that...

# re: Converting the Composite Web Application Block to Unity - Intro

I will waiting for your code, I think is amazing, I think it will be more ligth, elegant and decouple version of WCSF that are amazing too.  

I´m leader of community from Guatemala, and I´m planning present unity proyect and Will be nice If I can do with your WCSF verion.  

So my best wishes to you, in this amazing journey and expirence you already have.

Monday, April 07, 2008 10:39 AM by Manolo

# Web Client Software Factory Que es y que no es?

No es un generador de código, no amigos...para nada. Una Software Factory es mucho mas que eso y es necesario

Wednesday, April 09, 2008 2:17 AM by Manolo Herrera

# Converting the Composite Web Application Block to Unity - Clean Up ICompositionContainer

This is the third post in a series. The other post include Converting the Composite Web Application Block

Wednesday, April 09, 2008 7:06 PM by Espresso Fueled Agile Development

# Converting the Composite Web Application Block to Unity - Ummmm...Oooops.

This is the third post in a series. The other post include Converting the Composite Web Application Block

Tuesday, April 22, 2008 7:57 PM by Espresso Fueled Agile Development

# First Look at Unity

El pasado 4 de Abril del 2008, fue liberada la versión de producción del proyecto Unity. Este es un IoC

Friday, April 25, 2008 10:57 AM by Manolo Herrera

# Converting the Composite Web Application Block to Unity - Actually Adding Unity

This is the fifth post in a series. The other post include: Converting the Composite Web Application

Thursday, May 01, 2008 7:44 PM by Espresso Fueled Agile Development

# Converting the Composite Web Application Block to Unity - Using the UnityCompositionContainer

This is the sixth post in a series. The other post include: Converting the Composite Web Application

Wednesday, May 21, 2008 12:38 PM by Espresso Fueled Agile Development
Anonymous comments are disabled
 
Page view tracker