Showing posts with label DependencyInjection. Show all posts
Showing posts with label DependencyInjection. Show all posts

Tuesday, January 28, 2014

Community Driven XNA Game Studio Installer for VS 2012 and soon VS 2013

CodePlex - XNA Game Studio


Project Description
Support for XNA Game Studio until Microsoft will restore support.

Project which continue support to Microsoft XNA Game Studio for Windows.

Now we released XNA Game Studio Extension for Visual Studio 2013 as a VSIX package. We will upload this on Visual Studio Gallery in 9th February 2014.

Of note on the Documentation tab

How install XNA 4.0 on Visual Studio 2012
How install XNA 4.0 on Visual Studio 2013

How install XNA 4.0 on Visual Studio 2012

  1. Download XNA 4.0 Refresh (Visual Studio 2012)
  2. Unzip archive
  3. Install DirectX from the archive
  4. Install Xna Framework 4.0 Redistribution from the archive
  5. Install Xna Game Studio 4.0 Platform Tools from the archive
  6. Install Xna Game Studio 4.0 Shared from the archive
  7. Install XNA Game Studio 4.0 (2012).vsix from the archive

While I think this is pretty cool, REMEMBER THIS IS UNOFFICIAL. You're going to assume 100% of the risks in doing this and YMMV.

Still I applaud these guys for doing this. I hate having 3+ versions of VS installed just so I can fallback to a version that supports a given no longer supported project type (cough... XNA... cough... Setup and Deployment... cough).

Wednesday, August 21, 2013

Free eBook #2 for the day: Dependency Injection with Unity

Microsoft Downloads - Book Download: Dependency Injection with Unity

Unity is a dependency injection container. It is full-featured, with support for instance and type interception and custom extensions. Unity 3 also supports Windows Store apps.

Version: 1

Date Published: 8/20/2013

DependencyInjectionWithUnity.epub, 1.0 MB

DependencyInjectionWithUnity.pdf, 3.3 MB

Authors: Dominic Betts, Grigori Melnik, Fernando Simonazzi, Mani Subramanian.
Foreword by Chris Tavares.

Over the years software systems have evolutionarily become more and more complex. One of the techniques for dealing with this inherent complexity of software systems is dependency injection – a design pattern that allows the removal of hard-coded dependencies and makes it possible to assemble a service by changing dependencies easily, whether at run-time or compile-time. It promotes code reuse and loosely-coupled design which leads to more easily maintainable and flexible code.

The guide you are holding in your hands is a primer on using dependency injection with Unity – a lightweight extensible dependency injection container built by the Microsoft patterns & practices team. It covers various styles of dependency injection and also additional capabilities of Unity container, such as object lifetime management, interception, and registration by convention. It also discusses the advanced topics of enhancing Unity with your custom extensions.

The guide contains plenty of trade-off discussions and tips and tricks for managing your application cross-cutting concerns and making the most out of both dependency injection and Unity. These are accompanied by a real world example that will help you master the techniques. Keep in mind that Unity can be used in a wide range of application types such as desktop, web, services, and cloud. We encourage you to experiment with the sample code and think beyond the scenarios discussed in the guide.

In addition, the guide includes the Tales from the Trenches – a collection of case studies that offer a different perspective through the eyes of developers working on the real world projects and sharing their experiences. These chapters make clear the range of scenarios in which you can use Unity, and also highlight its ease of use and flexibility.

Whether you are a seasoned developer or just starting your development journey, we hope this guide will be worth your time studying it. We hope you discover that Unity container adds significant benefits to your applications and helps you to achieve the goals of maintainability, testability, flexibility, and extensibility in your own projects. Happy coding!

While I use Unity, I'm not really very good with it (and dare I say it's mostly "bing-code"?). I'm looking at this book hoping it will help me become one with Unity.. :P


Related Past Post XRef:
Enterprise Library 6 and Unity 3 are out today... (Semantic Logging and Transient Fault Handling Application Block added, other Blocks updated)

Friday, April 26, 2013

Enterprise Library 6 and Unity 3 are out today... (Semantic Logging and Transient Fault Handling Application Block added, other Blocks updated)

ALM and Beyond - Microsoft Enterprise Library 6 and Unity 3 Released

Microsoft Enterprise Library is a popular collection of reusable software components (called application blocks) designed to address common cross-cutting concerns of enterprise application developers (such as logging, validation, data access, exception handling, and more). Enterprise Library is provided as source code, test cases, and documentation that can be used "as is" or extended, and encapsulates the Microsoft recommended and proven practices for .NET application development.

Unity is one of the Enterprise Library application blocks which provides a lightweight, extensible dependency injection container with support for constructor, property, and method call injection, as well as support for instance and type interception. It facilitates building loosely coupled applications (including Windows Store apps).


What’s in the Box?

  • New Blocks
    • Semantic Logging Application Block [video]
    • Transient Fault Handling Application Block (this application block was previously a part of the Enterprise Library Integration Pack for Windows Azure; in this release it has been generalized and updated to the latest technologies).
    • Updated Application Blocks – 6 blocks from previous versions have been updated:
      • Data Access Application Block
      • Exception Handling Application Block
      • Logging Application Block
      • Policy Injection Application Block
      • Validation Application Block
      • Unity Application Block/DI Container (v3.0)
  • New Programmatic Configuration – Streamlining programmatic configuration of all blocks and improving ease of learning and ease of experimentation.
  • Configuration Console – largely unchanged from the previous release.
  • Reference Implementation – To versions of the same application: one using Enterprise Library 5 and one using Enterprise Library 6 to illustrate the changes and to help users migrate.
  • Guides – The “Developer’s Guide to Enterprise Library” is designed to introduce users to the library and explain how to use it through short, practical code examples. The new “Dependency Injection with Unity” guide introduces users to the Dependency Injection pattern, describes the problems it can solve, and shows how to use the Unity container in their own applications.


InfoQ - Microsoft Enterprise Library 6.0 Adds Semantic Logging


Enterprise Library 6.0 comes 3 years after EL 5.0 with a new application block, Semantic Logging, providing consistent format and structure of logging messages based on strongly typed events. Log messages can be saved simultaneously to multiple  destinations including flat file, console window, database or Windows Azure storage. An example of generating a log message for a UI error in an application, taken from the Developer Guide (PDF), looks like this:


Grigori Melnik: Thoughts on Agile Software Engineering and Beyond - Just released - Microsoft Enterprise Library 6

Five month ago we formulated our vision for the new version of Enterprise Library. Now we are delivering on it. I’m excited to announce the latest release of Microsoft Enterprise Library: version 6.

What is Enterprise Library?

Enterprise Library is made up of application blocks, each aimed at managing specific crosscutting concerns. Crosscutting concerns are those tasks that you need to accomplish in several places in your application. When trying to manage crosscutting concerns there is often the risk that you/different team members will implement slightly different solutions for each task at each location in your application, or that you will just forget them altogether. Writing entries to a system log file or Windows Azure table storage, dealing with transient error conditions and validating user input are typical crosscutting concerns. While there are several approaches to managing them, the Enterprise Library application blocks make it a whole lot easier by providing generic and configurable functionality that you can centralize and manage.

Enterprise Library application blocks are standalone. They work well together, but you only have to get the ones that you need. They are also customizable and extensible, so you can extend them to provide what you need in your specific contexts. You can choose to use it as a seedwork and grow your own library, which you can later reuse and sell. We ship under MS-PL, so this is allowed.

What are the main themes for this release?
  • Simplifying the library all around
  • Embracing semantic logging
  • Increasing resiliency to errors
  • Enhancing Unity type registration
  • Supporting Windows Store apps (Unity, Topaz)
  • Streamlining programmatic configuration of all blocks
  • Integrating with other technologies (ASP.NET MVC and ASP.NET Web API)
  • Improving ease of learning, ease of experimentation (fast start), and ease of use




Somasegar's blog - Enterprise Library 6.0


While this 6.0 release is filled with great things to talk about, I want to highlight three in particular:

  • .NET 4.5 saw the introduction of the EventSource class, which dramatically simplifies the task of doing ETW tracing in managed applications (ETW, or Event Tracing for Windows, is a fast and scalable logging mechanism built into the Windows operating system).  Enterprise Library 6.0 includes the new Semantic Logging Application Block, which enables you to have the simplicity and power of EventSource while still utilizing log formats and storage facilities you’re familiar with.  With this block, you can easily direct your log messages to a variety of destinations, such as rolling flat files, SQL Server databases, or Windows Azure table storage, while still maintaining the structured nature that ETW and EventSource provide.  This structure makes it much easier to later aggregate, query, and process the information you've captured.
  • LOB apps are more and more likely to be running in distributed environments, where intermittent error conditions are not uncommon.  The updated Transient Fault Handling Application Block, which helps to provide resilience against such conditions, has been updated with new detection strategies and with support for the new asynchronous programming features of C# 5 and Visual Basic 11, enabling increased scalability.  It’s also now available as a portable library for use with .NET 4.5, Windows Store apps, and Windows Phone apps.
  • Previous releases of Enterprise Library have included Unity, a lightweight and extensible dependency injection container that facilitates building loosely coupled applications.  With this release, it’s seen several important enhancements, including support for Windows Store apps.

As has been the case with Enterprise Library in the past, you can easily add to your projects just the blocks you need by using the NuGet package manager in Visual Studio:


You can check out the Enterprise Library at

Microsoft Downloads - Microsoft Enterprise Library 6

Microsoft Enterprise Library is a collection of reusable application blocks designed to assist software developers with common enterprise development challenges. This release includes: Data Access Block, Exception Handling Block, Logging Block, Policy Injection Block, Semantic Logging Block, Transient Fault Handling Block, Validation Block, and Unity.

Quick details

Version: 6.0
Date published: 4/25/2013

Language: English

EnterpriseLibrary6-binaries.exe, 1.0 MB

EnterpriseLibrary6-source.exe, 7.5 MB

Microsoft.Practices.EnterpriseLibrary.ConfigConsoleV6.vsix, 726 KB

SemanticLogging-service.exe, 1.0 MB

Microsoft Enterprise Library is a collection of reusable application blocks addressing common cross-cutting concerns. This release includes: Data Access Application Block, Exception Handling Application Block, Logging Application Block, Policy Injection Application Block, Semantic Logging Application Block, Transient Fault Handling Application Block, Validation Application Block, and Unity Application Block.
This major release of Enterprise Library contains many compelling new features and updates that will make developers and IT professionals more productive. Two new application blocks are:

  • Semantic Logging Application Block
  • Transient Fault Handling Application Block (this application block was previously a part of the Enterprise Library Integration Pack for Windows Azure; in this release it has been generalized and updated to the latest technologies)
Other major new features include:
  • New programmatic configuration that doesn’t require a container
  • AsynchronousTraceListenerWrapper for the Logging Application Block, which enables existing listeners to write messages asynchronously
  • JSON formatter for the Logging Application Block.
New Unity Application Block includes many improvements:
  • Registration by convention
  • Support for NetCore (Windows Store apps)
  • Resolving objects of type Lazy<T>
  • The Unity assembly is now Security Transparent
  • Support for ASP.NET MVC and ASP.NET Web API

The detailed list of all changes is included in the Release Notes.


All application blocks are also available as NuGet packages.

Microsoft Downloads - Microsoft Unity 3

Unity is a dependency injection container. It is full-featured, with support for instance and type interception and custom extensions. Unity 3 also supports Windows Store apps.

Quick details

Version: 3.0
Date published: 4/25/2013

Language: English

Unity3-binaries-only.exe, 401 KB

Unity3-binaries-symbols-source.exe, 1.6 MB

This major release of Unity includes the following new features:

  • Registration by convention.
  • Support for NetCore (Windows Store apps).
  • Resolving objects of type Lazy<T> by Unity.
  • The Unity assembly is now Security Transparent.
  • Support for ASP.NET MVC and ASP.NET Web API.

The detailed list of all changes is included in the Release Notes


Also available via NuGet.

Enough said?

Thursday, April 11, 2013

Unity vs. MEF - right for you, one is...

Visual Studio Magazine - Unity vs. MEF: Picking the Right Dependency Injection Manager

Peter Vogel compares both of the Microsoft dependency injection managers/inversion of control containers and comes up with a decision tree for picking the correct one.

I think dependency injection containers make it so much easier to implement designs that include many dedicated objects that I'm not sure I could live without one anymore. Microsoft, though, provides two: the Managed Extensibility Framework (MEF), which is part of the Microsoft .NET Framework, and the Unity Container (Unity), which is available as a NuGet download. While there are also several open source tools available, these are the two that are easiest to add to your project. So the question is: Which should you use?

I've discussed MEF and Unity separately, but it's worthwhile to take the time to discuss what I like about each of them and when to use each. One caveat: Both tools are sufficiently "feature rich" that I'm almost certain to get something wrong. I hope comments on this article will address any glaring errors on my part.

First, an overview: Both tools allow you to define containers that you can load with classes or objects. Once you load a container with classes, both frameworks will instantiate the classes and hand you back the resulting objects. Both frameworks allow you to specify what values are to be passed to constructors or used to set properties and call methods when classes are instantiated. Both containers allow you to control the lifetime of those objects -- allowing you, for instance, to specify that only a single instance of some object is ever to be created (effectively implementing the singleton pattern).


Unity vs. MEF: The Decision Tree


The good news is both MEF and Unity are excellent tools, so neither is a bad choice. The bad news is, three months after picking one, you'll run into a problem that would've been easier to solve with the other tool.


Peter's closing sentence made me laugh out loud. So, so true.

Currently I'm on the Unity track as I'm building a Prism app, and it seemed the Unity extensions just felt more natural.

Monday, February 25, 2013

ClickOnce, Windows 8 and SmartScreen (If you're using ClickOnce, planning on Windows 8 [Desktop] and don't have a CA cert, read this...)

RobinDotNet's Blog - Windows 8 and ClickOnce : the definitive answer

There have been a lot of copies of Windows 8 sold since it came out a few months ago, and the Surface Pro was just released. (In fact, I’m writing this on my brand new Surface Pro, which I really like, but that’s a subject for another time.)

If you’re using ClickOnce deployment, you’re probably wondering how (or if) it’s going to work with Windows 8. I’ve worked with Saurabh Bhatia at Microsoft to ensure that this article will cover what you need to know. We use ClickOnce at GoldMail (whose product is now called Point Across) for our desktop product and VSTO applications, as well as several internal utility applications, so I’ve also tested this on our products to make sure it’s accurate.

If you are hosting your deployment on a file share or on an intranet, you won’t have to make any changes. You can go get ice cream now while the rest of us soldier on.

If you are hosting your deployment on the internet, you will eventually get calls from your customers who have upgraded to Windows 8 or purchased a Windows 8 machine. So let’s talk about that.

I’m not going to talk about the bootstrapper right now; that’s going to come up later. For now, let’s concentrate on the ClickOnce application itself. When a user installs a ClickOnce application on Windows 8, here’s what happens:


How will the application work after publishing it with a signed executable?

If you sign your executable and your deployment with a valid certificate from a Certificate Authority like Verisign using one of the methods above, when the user clicks install, it will install without stopping and showing the SmartScreen filter, and updates will do the same. Yay!

Do I have to use a certificate from a Certificate Authority to circumvent the Smart Screen Filter?


Is there any workaround?



This is a great article on ClickOnce in the Win8/IE10/SmartScreen filter world. Looks like I'm going to have to pony up and get a real cert, which is not all that bad, but still...

Thursday, February 16, 2012

All in One Unity Demo and Information Series

CodePlex - Unity All In One

This projects intends to show features in Unity and different ways of working with it.

A couple of thing to know before starting is how the project is structured. The launching point for this project is UnityDemo.ConsolePresenter which has the Program files. To make it more relatable i've used the Duck analogy from HeadFirst deisgn pattern but in my own way. Solution has a Common and a Unity code Library folder where all the samples lie. Feature's are mostly broken down as assemblies . It's best to start with UnityDemo.RegAndResCode project but after that you can go through any feature you like. For convenience sake I have a dictionary or Features and within it a dictionary of Samples. All you have to do is change the index number to go directly to the code class. A detailed explanation about each feature can be found here

Features sampled uptill now are :

  1. Regitsering types
  2. Resolving Types
  3. ResolveAll
  4. DependencyAttribute
  5. LifeTime manager
    1. Transient
    2. ExternalControlled
    3. ContainerControlled
    4. PerThreadControlled
    5. HierarchicalLifetimeManager
  6. Injcetion constructor
  7. AutomaticFactory
  8. Interception
  9. Confuration File
    1. Adding Intellisense Support

..." [GD: Project Description Leach Level: 99%]

Unity All in One : 2 of N : Adding Intellisense in the App.config

"Visual studio Intellisense is one of the best feature’s in Microsoft arsenal. So if at any point I don’t have it working for me I end up spending more time then I probably should be. This is specially true while configuring the config file for Unity. May be I’m jumping ahead. Lets step back to the most crucial question here

“Why should i use a config file at all for Unity ? “

I generally tend to have behaviours and model split across assemblies. So there may be a situation where I havent referenced an assembly. But I know that by the time you get here it’ll be registered. So no harm done. But that just me.

Ok moving forward. How do I get an Intellisense in the config file for Unity configurations ? . The problem is Visual studio doesn’t have a schema defined for the Unity’s configuration section. A simple way would be to install the Enterprise Library by Microsoft. It come with a schema for Unity. To verify if you have a schema follow the mentioned steps


This looks like a great resource, both the Codeplex Project and the blog, for getting up to speed and checking out Unity...


(via Microsoft Developer Network - Samples - Unity All In One)

Monday, August 01, 2011

Can we get a little Unity?

Developers' Hangout Blog - Introduction to Unity Application Block 2.1

“In this post I would like to do a simple introduction to Unity Application Block. Unity is a framework that supports dependency injection (DI) in constructors, properties, and method calls. Unity also supports intercepting method calls which I may cover in a later post.

The documentation for Unity is pretty detailed, so it is probably a good place to start for background information. I’ve also included a link to the download area in the references section at the bottom of the post.

What is Unity and why would you use it?

When you start a project, the code base is usually small so it is not difficult to maintain or test. As the project gets larger, it is often the case that it gets broken down into components, and each component is created separately, and then integrated into the rest of the project.

In the beginning, the components are self contained and testable on their own if the person doing the work was paying attention to object oriented design principles. Even if the component was carefully constructed, at some point during integration it is usually the case that component boundaries begin to break down and components start having strong dependencies on each other.

Part of the break down of component boundaries happens because components start to inherit responsibility for configuring the dependencies with other components. Once a component has built in knowledge on how to create and configure another component, it becomes difficult to separate the components and test them independently.

This is where Unity comes in. Not only does Unity take the responsibility for creating and configuring components, it does so in a consistent way. Components don’t have to know where their dependent components come from. In addition, Unity can automatically create the dependent components if, necessary, or use existing instances.


Been a good while since I’ve blogged about, or [sheepish grin] looked at, Unity so a review of it, what it can do and how it can help use build better apps is timely…


Related Past Post XRef:
IoC? What? Man, I’m just a line of business dev trying to get through my day… What is this inversion of control/IoC, Dependency Injection thing?
Still trying to figure out what DI/IoC but are afraid to speak up?

Writing a MMC Plugin, with MVP and Unity
The Microsoft Patterns & Practices Catalog Cheat Sheet
Microsoft Enterprise Library 5.0 and Unity 2.0 RTW (& EntLib 3.x, 4.x to 5.0, Unity 1.x to 2 Migration Guide)

Wednesday, December 01, 2010

IoC? What? Man, I’m just a line of business dev trying to get through my day… What is this inversion of control/IoC, Dependency Injection thing?

Making the Complex Simple - Basic to Basics: Understanding IoC Part 2 (Creation)

“In my last back to basics post we talked about what inversion of control (IoC) is in regards to inverting control of interfaces.

We looked at how we can benefit from changing the control of the interface from the service to the client of that service.

This time we are going to tackle the more common form of IoC that is quite popular these days, and I’m going to show you why dependency injection is only one way to invert the control of the creation of objects in our code.


I’ve really been enjoying John’s Back to Basics posts… Sometime you just need a review/brain cell refresh (or a jump start in breaking out of your day-to-day code grind and into learning something new… :)

Make sure you also catch the other posts in his series (to date);

Saturday, November 13, 2010

Stick a fork in it, Prism 4.0 is done…

.NET Developer Guidance - Prism 4.0 For Visual Studio 2010, .NET Framework 4.0, WPF & Silverlight 4


Prism provides guidance designed to help you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications, Silverlight Rich Internet Applications (RIAs) and Windows Phone 7 applications. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build applications using loosely coupled components that can evolve independently but which can be easily and seamlessly integrated into the overall application. Such applications are known as often referred to as composite applications.


[GD: Click through for the links]…


Prism is intended for software developers building WPF or Silverlight applications that typically feature multiple screens, rich user interaction and data visualization, and that embody significant presentation and business logic. These applications typically interact with a number of back-end systems and services and, using a layered architecture, may be physically deployed across multiple tiers. It is expected that the application will evolve significantly over its lifetime in response to new requirements and business opportunities. In short, these applications are "built to last" and "built for change." Applications that do not demand these characteristics may not benefit from using Prism.

Key Benefits

  • Provides guidance and a re-usable library to help you develop flexible, easy to maintain WPF and Silverlight composite applications
  • Helps you to understand, implement and use key design patterns, such as MVVM and Dependency Injection
  • Supports the development of modular applications, allowing parts of your application to be fully developed and tested by separate teams
  • Helps you re-use application code and components across WPF and Silverlight, allowing you to create multi-targeted client experiences
  • Allows you to build a designer-friendly, dynamically composed user interface for your application
  • Includes reference implementations, quick-starts, hands-on-labs, as well as a comprehensive developers guide to get you up to speed quickly
  • Includes full source code to support code re-use or customization or for reference and education

In this Release


Microsoft Downloads - Prism 4.0 - November 2010


File Name: Prismv4.exe
Size: 23.5MB

Quick Details

Version: 4.0
Date Published: 11/11/2010

Prism provides guidance designed to help you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications and Silverlight Rich Internet Applications (RIAs) and Windows Phone 7 applications. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build applications using loosely coupled components that can evolve independently but which can be easily and seamlessly integrated into the overall application. Such applications are known as often referred to as composite applications.


patterns & practices: Prism  - Prism 4 Documentation (aka “Developer’s Guide to Microsoft Prism”)

“Released: Nov 12 2010'

Dev status: Stable


Prism 4 Documentation (CHM)
application, 15338K, uploaded Fri…

Prism 4 Documentation (PDF)
application, 14408K, uploaded Fri…


I dig that the full source code is included. Love that…

We’re using Prism 4 for the first time at work and so far it seems to be going well (at least Peter has attempted to kill me for suggesting we use it… ;)

Here’s a snap of the free 342 page Dev Guide;



Related Past Post XRef:
How about some free MVVM training/hands on/walkthroughs right in the VS box? “In the Box – MVVM Training” from Karl Shifflett (Oh yeah, with some WPF, Test, Moc, and Prism too)

Wednesday, April 29, 2009

Reference Assistant – Commercial (with free 30 day trial) Visual Studio Add-in to help cure IoC reference headaches

Darren’s Blog - Announcing Reference Assistant 1.0

“The product I have been working on, Reference Assistant, was released a few weeks ago.  Reference Assistant is an extension for Visual Studio 2005 and 2008 (and soon 2010).  In short, the goal of the product is cut down the time spent debugging runtime errors due to missing dependencies or errors in configuration.


Here are a few highlights of the capabilities in version 1.0:

  • Configuration files for, Windsor, and Unity can be parsed and displayed visually in a tool window.  Missing or incorrectly spelled types are pointed out (project reference paths are searched for required dependencies). 
  • Navigation to object definitions in supported IoC/DI configuration files
  • Any dependencies detected in configuration files can be automatically copied to the project output directory upon successful build.
  • Reference Paths can be setup automatically using rules setup in preferences.
  • Version conflicts between dependencies are displayed visually and in a tool window.
  • Generate a report of all required assemblies for a project’s deployment, including dependencies defined in IoC framework configuration files.
  • Extensions can be written to support custom file formats or configuration types.

For more detail in addition to the product pages, we have written a blog post walking through the functionality available in Reference Assistant for XML configuration.


“Friend of the Blog” Darren Stokes, of Visual Studio Links fame (yes, Daren, Fame!.. Is Visual Studio Links is cool and a must read link blog for Visual Studio developers, so just accept the adulation… ;) has recently released this cool sounding Visual Studio Add-in to help resolve reference pain and suffering. I don’t yet use Spring, Windsor, Unity (yeah, I know, I’m lame… um… shut up?  ;) but I can still see how this add-in could come in real handy.

Friday, September 12, 2008

Still trying to figure out what DI/IoC but are afraid to speak up?

CodeProject - Design pattern – Inversion of control and Dependency injection

  • “Introduction
  • The problem – tight coupling
  • Solution
  • Principles of IOC
  • Ways of implementing IOC
  • Implementing the DI
  • What’s wrong with DI FACTORY?
  • The container way
  • Implementation using Windsor
  • References
  • Other Interview question PDF's

In this section we will discuss about how IOC and DI can help us build loosely coupled software architecture. I am not sure should we call this a design pattern or more of a approach. If you search around the web you will see lot of controversy on whether IOC is a design pattern or not. From my point of view it is a design pattern as it solves a problem context.
It would be great to see actual architectures implementing IOC using container oriented approaches. I am sure it will change the way we think about interaction between components.
So let’s understand in detail about IOC and DI.
I’m not afraid to say it… I’m still trying to wrap my head around DI/IoC. There, I said it! I mean I get it but I am not sure I really "GET” it, know what I mean? (Note to Self: And I probably won't until I start coding with it, so start coding with it dummy!  ;)  (You can tell it's a Friday and I start talking to myself and calling myself a dummy... lol)

And I'd bet there's a silent developer majority our there who might be in the same boat as me. We've heard about it, seen few casts, read a few articles, but have yet to actually jump in...

The above Code Project has a few translation issues, but I liked it. I thought it presented one of the problems DI/IoC is trying to solve well and did a good job (with pictures! ;) explaining why DI/IoC is a good solution. The code samples, using Castle Windsor, are also easy to follow and understand.

This article will not be your only stop on the groking DI/IoC, but it's work a quick pitstop...

Friday, April 04, 2008

Unity 1.0, Microsoft's Dependency Injection, Inversion of Control (DI/IOC) Container, has RTW'ed

Microsoft Downloads - Unity Application Block (RegWare)


The Unity Application Block (Unity) is a lightweight, extensible dependency injection container. It facilitates building loosely coupled applications and provides developers with the following advantages:

  • simplified object creation, especially for hierarchical object structures and dependencies.
  • abstraction of requirements; this allows developers to specify dependencies at run time or in configuration and simplify management of crosscutting concerns.
  • increased flexibility by deferring component configuration to the container.
  • service location capability; this allows clients to store or cache the container.


  • Microsoft .NET Framework 2.0, 3.0, or 3.5
  • Microsoft Visual Studio 2005 or Visual Studio 2008 development system (any of the the following editions):
    • Stand Edition
    • Professional Edition
    • Team Edition for Software Developers
    • Team Edition for Software Testers
    • Team Edition for System Architects
    • Team Suite
  • " [Description leached in near full]

    Microsoft Downloads - Unity Application Block Documentation for Visual Studio 2005

    "The integrated documentation for the Unity Application Block (Unity) to be used with Visual Studio 2005.


    Microsoft Downloads - Unity Application Block Documentation for Visual Studio 2008

    "The integrated documentation for the Unity Application Block (Unity) to be used with Visual Studio 2008.


    Now if only I truly knew how to best use and apply this...

    Oh well, I guess you have to start somewhere.  :)

    Friday, March 14, 2008

    Another list from Scott Hanselman - Inversion of Control/Dependency Injection (IoC/DI) Frameworks for .Net

    Scott Hanselman's - List of .NET Dependency Injection Containers (IOC)

    "I'm trying to expand my mind around dependency injection in .NET (beyond the two frameworks I've personally used) and an starting to put together a list of .NET Dependency Injection Containers and IOC resources.

    Here's what I've got so far. What am I missing?


    The major players are listed as are a few lessor known/mentioned ones. Make sure you also view the comments as there are a couple list there too. Also included are links for additional IoC/DI information.

    Saturday, February 23, 2008

    More IoC - A Castle Windsor and Unity Application Block Comparison

    Matthew Podwysocki's Blog - IoC and the Unity Application Block - Going Deeper

    "I thought after my recent F# post, I'd get back to the Unity post that was halfway done before the firestorm began...

    In a previous post, I showed how easy it was to create a basic application using the Unity Application Block. I'm always finding new ways to solve my problems and new tools to do it.  Since Inversion of Control (IoC) containers are near and dear to my heart, I thought I'd investigate to see whether it meets my needs or not.  It's something you need to determine on your own, whether it works for you.  Some like Spring.NET, others StructureMap, Castle Windsor and so on.


    Compare/Contrast with Windsor

    Anyhow, today I will focus on a little compare/contrast with Castle Windsor just to show the different styles used.  I'm not going to say one is better than the other, because quite frankly, that's up to you to decide...  I want to thank Dustin Campbell for his help in getting a better code formatter via this post here.


    More IoC (Inversion of Control) reading material.

    Also I believe this is my first reference to the very recently released Unity Application Block (a "lightweight extensible dependency injection container with support for constructor, property, and method call injection").


    Related Past Post XRef:
    Getting to know IoC (Inversion of Control) Container
    Take a Lunch Break with Windsor IoC Container (part of the Castle Project)