The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








I heart FeedBurner

Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 4,741,920
since: 19 Jan 2005

Microsoft releases new predictive Dependency Injection / Inversion of Control Container

posted Wed 01 Apr 09

Just this morning I managed to get my hands on some new bits that I think people might be interested in. If you're familiar with the concepts behind Inversion of Control and Dependency Injection (just a special type of IoC really) then you might want to keep reading.

Basically what a DI framework lets you do is decouple the dependencies within your application. Rather than a controller having code in it that is manually new'ing up a reference to the view and the model, a DI framework lets your controller simply state that it needs a view of a certain type and a model of a certain type. The wiring up is then done for you automatically either at compile-time or runtime (or a little of both, depending on what you're using).

The problem with this approach is that it requires developers and architects to actually figure out what dependencies each piece of their application needs. Worse, this often requires developers to do some hard thinking about how they want to split their application into components to maximise re-use, increase efficiency, and create a highly resilient application. These are all admirable goals but let's face it - it sounds an awful lot like work.

What we really need is the next level of Dependency Injection.... Predictive Dependency Injection. Instead of us having to be explicit about the code on which other code depends, Predictive Dependency Injection (PDI) works by figuring out what you're going to need and when you're going to need it, and putting it there.

Say, for example, you're building an online banking application that allows customers to look at their transaction history and perform basic transactions like withdrawals, transfers, etc. Rather than having to go through the tradiational (hard work!) process of figuring out what components you're planning on building and how they all inter-relate with each other, now you can let PDI do the work for you.

Basically it works like this:

var bankingApplication = PredictiveUnity.Resolve<WhatIWant>();
bankingApplication.DoWhatIWant();

The PDI container will figure out what kind of app you're building and, using a combination of an advanced code generation tool (acronym: ESP) and other predictive heuristics the PDI container will make available to you an instance of an object that provides the backing functionality for your application. It creates several methods on this generated object that will perform the tasks that you need.

This doesn't sound all that interesting, right? But here's where it becomes a useful tool: you don't need to figure out what you need at the time you're coding it. The DoWhatIWant() method will figure out what the app needs to do and do it. The developer no longer has to be burdened with the hard work of design, analysis, or the tedium of manually typing C# code.

I recommend PDI for every developer who is currently thinking that tasks like design and coding are old-school and there's something better out there.

You can download the first CTP of Predictive Dependency Injection here .

tags:          

links: digg this    del.icio.us    technorati    reddit

AddThis Social Bookmark Button




Tag Related Posts

Geneva Distilled

Thu 09 Apr 09 1:27 P GMT-05

WPF Control Development Unleashed

Wed 25 Mar 09 2:26 P GMT-05

What's New in Silverlight 3

Fri 20 Mar 09 2:38 P GMT-05

MIX 2009 - Day 1 Recap

Thu 19 Mar 09 2:17 P GMT-05

At MIX 2009, pre-keynote

Wed 18 Mar 09 2:50 P GMT-05

Live Framework April 2009 CTP is out!

Fri 13 Mar 09 12:11 P GMT-05

Velocity CTP3 coming up next week

Thu 12 Mar 09 4:44 P GMT-05
tags:            

My first day using Windows 7 Beta 1

Wed 25 Feb 09 1:58 P GMT-05

Microsoft Windows Azure Distilled

Tue 28 Oct 08 1:42 P GMT-05

Microsoft's Lofty Direction

Sun 05 Oct 08 2:30 P GMT-05

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

One Framework to Rule them All

Mon 25 Feb 08 6:49 P GMT-05

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

Installing Orcas Beta 1 - VMware Style

Mon 23 Apr 07 12:16 P GMT-05

Orcas Beta 1 Released

Fri 20 Apr 07 7:09 P GMT-05

Tech-Ed 2006 Day 1 - Registration Day

Sun 11 Jun 06 7:17 P GMT-05

Dan Brown's got competition

Mon 05 Jun 06 3:51 P GMT-05