skip to the main content area of this page
Patterns and Practices

IoC


 

Unity Configuration from Separate Configuration File

If you have to configure Unity via a configuration file, better to do it in a separate configuration file from your App.config or Web.config.

Read More

Enterprise Library 4.1 and Unity 1.2 Hands-on Labs Download - Patterns & Practices

Download the new hands-on labs for Enterprise Library and Unity.

Read More

Testing If Type Has Been Registered With Unity - Patterns & Practices

Erwin Van Der Valk has an interesting post on such an extension.

Read More

Registering Factory Method to Create Objects with Unity - StaticFactoryExtension

A quick sample on using the StaticFactoryExtension to register factory methods to create objects with Unity.

Read More

Develop Your Own Dependency Injection / IoC Container Using TDD Screencast Series

This sounds promising - a screencast series on developing a DI tool using TDD.

Read More

StructureMap 2.5.1 Released - Dependency Injection and Inversion of Control Container

Jeremy mentions the release of StructureMap 2.5.1.

Read More

Unity Dependency Injection for Silverlight Released - Patterns & Practices

Download it now.

Read More

Unity and Silverlight - Dependency Injection and IoC with Unity in Silverlight Applications

Chris mentions a new source code drop with a few changes.

Read More

The Unity Framework on .NET Rocks!

I forgot about this. Last month I recorded a show with Carl and Richard from .NET Rocks! where we got to talking about Unity, EntLib, Software Factories, and what have ya.

Read More

Generic Decorator Chains Example using Unity Dependency Injection Container

A quick sample on generic decorator chains using Unity.

Read More

Download Enterprise Library 4.1 with Unity Application Block v1.2

Enterprise Library 4.1 is released.

Read More

AOP and Unity - InterfaceInterceptor Example - Unity Dependency Injection Tutorials

More discussion of the new AOP features in Unity v1.2.

Read More

Top 5 Reasons to Choose Unity Dependency Injection Container

I get this question all the time so here are some thoughts off the top of my head.

Read More

VirtualMethodInterceptor in Unity v1.2 - For Those Castle DynamicProxy Fans...

I had a chance this evening to play with the new VirtualMethodInterceptor in Unity.

Read More

TransparentProxyInterceptor and Unity Interception Extension Example in Unity v1.2

I suspect Chris Tavares is enjoying changing the name of the interceptor in Unity v1.2 just to make me keep updating my examples :) That's okay, I probably deserve it!

Read More

Extend Unity and UnityContainer with Extension Methods in C# 3.0

A simple extension method to create a RegisterSingleton<T> Method on UnityContainer.

Read More

Unity Interception Extension Example - TransparentProxyPolicyInjector HandlerAttribute ICallHandler

As promised, here is a quick sample on using the TransparentProxyPolicyInjector in Unity v1.2.

Read More

Unity and StructureMap - Dynamically Configuring Constructor Injection via Fluent Interfaces

I have a preference for StructureMap when it comes to dynamically configuring constructor injection via the fluent interfaces.

Read More

Common Service Locator Library - IServiceLocator Interface Abstracting IoC Containers

For those wishing to minimize the footprint of your IoC Container in your .NET Libraries and Frameworks.

Read More

New Unity Drop - TransparentProxyInterception and TransparentProxyPolicyInjector

There is a new drop of Unity dated September 29th on CodePlex. Here are a few changes I noticed in the source code.

Read More

Dependency Injection and Loose Coupling Primer on ARCast.TV

Mario Cardinal does a good job of explaining the importance of Dependency Injection, Loose Coupling, and SRP in Software Development.

Read More

Unity IoC - Optional Dependency Injection Sample from Extending Unity Samples

A quick sample on how to use the OptionalDependency Attribute in the samples available from the Extending Unity Webcast.

Read More

Download Extending Unity Samples from Unity Webcast

There is no documentation or on-demand webcast available to assist you with extending Unity at this time, but you can download a couple of samples from the webcast.

Read More

Unity 1.2 First Drop - Silverlight - CLR Bug Fix - Generic Decorator Chains

The first Unity 1.2 Drop is here.

Read More

Enterprise Library 4.1 and Unity 1.2 Project Kickoff

Grigori Melnik mentions the project kickoff of Enterprise Library 4.1 and Unity 1.2. In particular, I am excited about the AOP Interception Mechanism and Policy Injection Application Block Integration!

Read More

StructureMap Tutorial - Dependency Injection and IoC in .NET

StructureMap is one of a number of dependency injection frameworks for the .NET Framework. Version 2.5 is expected to be released in the near future. Here are some tutorials to get you started.

Read More

Extending the Unity Dependency Injection Container Webcast

Documentation on Extending Unity has not been added as of yet to the help file and on the web, so you will want to watch this webcast on Extending the Unity Dependency Injection Container.

Read More

Dependency Injection with Microsoft Enterprise Library Unity Application Block Webcast

Again, you probably missed the Unity Webcast by Microsoft Patterns and Practices because it happened at 12pm Pacific Time today as opposed to 8pm Pacific Time today as shown on Microsoft Events. So, you don't get to provide them valuable feedback and get your questions answered, but you can watch it on-demand when it is available.

Read More

Unity and ASP.NET Web Pages Dependency Injection Part II with Special Guests - Autofac and Ninject

In this screencast we discuss ASP.NET Webforms Dependency Injection with Unity using a custom HttpModule that injects dependencies into web pages, masterpages, and usercontrols without the need for base classes. Inspiration is taken from two open-source, lightweight, and easy to use Inversion of Control Containers - Autofac and Ninject.

Read More

Autofac Dependency Injection Integration with Castle DynamicProxy2 and NMock2

The Autofac Contrib Project adds new extensions to Autofac that support AOP Method Interception via Castle's DynamicProxy2 as well as an auto-mocking container via NMock2.

Read More

Ninject Dependency Injection and IoC Tutorials on ASP.NET and Castle DynamicProxy2

Ninject 1.0 was recently released, but there are not a lot of tutorials, if any, to be found. I put together 3 tutorials that show using Ninject with ASP.NET Web Pages, Mapping Open Generic Types, and for AOP Method Interception using Castle's DynamicProxy2.

Read More

Ninject 1.0 Released - Lightning Fast Dependency Injection for .NET

Nate Kohari releases 1.0 of Ninject, his lightning fast dependency injection framework for .NET.

Read More

Unity IoC and ASP.NET Screencast - Dependency Injection into Web Pages

A new screencast showing one way to use the Unity IoC Container from Microsoft Patterns and Practices with ASP.NET Webforms. It discusses using the UnityContainer.BuildUp Method in a Base Page Class to inject dependencies into your web pages. The screencast also shows how to attach the UnityContainer to the Global Class in ASP.NET and access it via an IContainerAccessor Interface. You can download the source code shown in the screencast.

Read More

Microsoft Community Summit Presentation - Enterprise Library 4.0 and Unity IoC

During the Microsoft Community Summit from June 7-8, 2008, I presented the following Topic - Enterprise Library 4.0 and Unity IoC. The presentation discussed the integration of Enterprise Library 4.0 with Unity IoC and, in particular, how to use the Data Access Application Block, Logging Application Block, and Validation Application Block in a layered application using Model-View-Presenter.

Read More

Unity 1.1 Download Released - Lightweight and Extensible Dependency Injection Container

Right after the release of Enterprise Library 4.0 the Microsoft Patterns &amp; Practices Team announces the release of Unity 1.1, their lightweight and extensible Dependency Injection Container.

Read More

Dependency Injection in C# 3.0 with Autofac CodeProject Article

Nick Blumhardt wrote an article on CodeProject that shows how to use Autofac for dependency injection in your applications.

Read More

Unity Contrib Project Opens Its Doors - Unity Extensions Samples Tutorials

With the release of Unity 1.0 we now have the Unity Contrib Project, which is a community-driven project where ObjectBuilder and Unity IoC Gurus can submit Unity Extensions, Samples, and other assets to share with the developer community.

Read More

LinFu Articles on CodeProject Well-Worth Reading

Stretch your mind a bit by reading the LinFu Articles on CodeProject regarding DynamicProxy, Mixins and Duck Typing, Inversion of Control, Design By Contract, and AOP. You don't have to like or use LinFu to appreciate the topics.

Read More

Autofac IoC Tool

If you haven't settled on an IoC Tool or become completely obsessed with the dependency injection tool you use, you may want to look at Autofac, which utiltizes a number of C# 3.0 Features, like Lambda Expressions, Expression Trees, and Extension Methods, to give you an intuitive IoC Tool that is pretty extensible. Read more...

Read More

Unity 1.0 Released - Microsoft IoC and Dependency Injection

Unity 1.0 was released from Microsoft Patterns &amp; Practices. The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection. It runs on top of ObjectBuilder 2.0.

Read More

Unity IoC - Dependency Injection in ASP.NET MVC Framework Screencast

This screencast shows step-by-step how to add the Unity IoC Container to an ASP.NET MVC Framework Application to create controllers and inject their dependencies. It discusses DefaultControllerFactory, IControllerFactory, ControllerBuilder, and registering and resolving types with IUnityContainer.

Read More

Unity March 24 Update: Mapping of Generic Types - Injection Configuration - Performance Improvements

A new Unity release on March 24, 2008 that includes mapping of open generic types, the ability to specify injection configuration via a configuration file, and some performance improvements...

Read More

List of .NET IoC Containers and Dependency Injection Tools

Scott Hanselman created a list of Inversion of Control ( IOC ) and Dependency Injection Tools for the .NET Framework. I have used quite a few of them, including: Castle Windsor, StructureMap, Spring.NET, Autofac, Unity, and the Do-It-Yourself Method. If you haven't chosen an IoC Tool, there are certainly plenty to choose from...

Read More

Unity Release Date Rescheduled for April 7 - Probably EntLib 4.0 too...

Grigori mentions that the release date for Unity has been rescheduled for April 7, 2008 as opposed to the original March 15, 2008. There is a good chance that Enterprise Library 4.0 CTP 1 will be pushed back to April 7th as well, but Grigori didn't say one way or the other.

Read More

New Unity IoC Screencast

I created a new Unity IoC Screencast based on a number of changes to the Unity API as well as a new release of the ASP.NET MVC Framework Preview 2. In addition to showing how to use Unity with ASP.NET Webforms Model-View-Presenter and the ASP.NET MVC Framework, the new Unity Screencast shows about a dozen common usages of Unity, including...

Read More

Unity IoC - March 12th Weekly Drop - New API for Configuring Injection

The Unity Dependency Injection Tool from Microsoft has a new installer this week as well as a new API for configuring injection so that you no longer need to add attributes to your classes to signal constructor, property, and method injection. Read more...

Read More

Unity IoC and ASP.NET MVC Framework - Dependency Injection of Controllers

An updated code sample of using the Unity IoC Container with the ASP.NET MVC Framework based on the API Changes to Unity that occurred on the March 4th, 2008 Weekly Drop. Unity can be used in a CustomControllerFactory to create your MVC Controllers and inject dependencies. The sample code is modeled after the Castle Windsor Example in MVCContrib.

Read More

Unity Nested Containers - IUnityContainer and CreateChildContainer

The Unity Inversion of Control and Dependency Injection Container from Microsoft Patterns and Practices supports nested containers, where a Parent Container has the ability to create child containers. What is cool about the Parent-Child Relationship between UnityContainers is that by default Unity will search the local container to resolve a type mapping, and if not found, will navigate up to any Parent Containers to resolve the type. This provides the ability to override global ( parent ) type mappings with local ( child ) type mappings.

Read More

Unity IoC - February 26 Weekly Drop - LifetimeManagers TearDown Extensions and IDisposable

Unity has a few changes in the February 26th Drop: 1) SetLifetime method allows you to specify a LifetimeManager object for a particular dependency, 2) Teardown: Unity now has a Teardown method which objects can be run through to shut down / clean up / whatever you want, and 3) Extensions can implement IDisposable: If an extension object implements IDisposable, it now gets disposed when the container does. Read more...

Read More

Orlando Code Camp 2008 Presentation - Introduction to the Web Client Software Factory ( WCSF ) v2.0

David Hayden will be presenting Introduction to the Web Client Software Factory ( WCSF ) v2.0 at the Orlando Code Camp in Orlando, Florida on Saturday, March 22nd, 2008. Create more maintainable and responsive ASP.NET Web Applications faster using the Web Client Software Factory v2.0. In this session we will explore the cool new AJAX Bundles in the WCSF that help you with AutoComplete, ServerSide Validation, and Real-Time Search Functionality both within ASP.NET and ASP.NET Dynamic Data Websites. We will also explore creating more testable and loosely-coupled web applications using Model-View-Presenter and dependency injection in both ASP.NET Webforms and ASP.NET MVC Applications.

Read More

Unity Dependency Injection IoC Screencast

The Unity Dependency Injection / IoC Container is new from Microsoft Patterns and Practices. It will come in both a stand-alone version and within Enterprise Library 4.0 as an alternate configuration mechanism for the application blocks. This screencast shows several common usages of Unity as well as how to use Unity with both the ASP.NET MVC Framework and with ASP.NET Webforms using Model-View-Presenter.

Read More

UnityContainer and UnityConfigurationSection - Populating Unity Container via App.config or Web.config

The Unity IoC Tutorials provided to date using the ASP.NET MVC Framework and ASP.NET Model-View-Presenter have programmatically added services and components via the Register and SetSingleton Methods on UnityContainer. In this Unity Tutorial, I will populate the UnityContainer from services registered in a Web.config file. One can easily use an App.config file as well.

Read More

Unity IoC Dependency Injection and ASP.NET Model-View-Presenter

The Unity IoC Container can be used in your ASP.NET Web Applications to provide dependency injection, especially when using Model-View-Presenter. There are several ways that one can use Unity to wire-up the presenter class and its dependencies to the ASP.NET view. In this example, I will use a Page Base Class that accesses the UnityContainer on the HttpApplication Class and uses Unity to create an instance of the Presenter Class associated with the view.

Read More

Unity Dependency Injection Container Released - February 2008 CTP

The Microsoft Patterns and Practices Team released the February 2008 CTP of the Unity Dependency Injection Container. Unity will be offered as both a stand-alone dependency injection container and as a configuration option within Enterprise Library 4.0. Unity uses ObjectBuilder 2.0 as its underlying engine...

Read More

Unity Dependency Injection Container Uses ObjectBuilder 2.0 - Enterprise Library 4.0

The new Unity Dependency Injection Container available as stand-alone or within Enterprise Library 4.0 uses ObjectBuilder 2.0. ObjectBuilder 2.0 was started by Brad Wilson and Scott Densmore for use as the Dependency Injection Container for CodePlex. ObjectBuilder 2.0 will now be used as the shiny, new engine for both Enterprise Library 4.0 and Unity...

Read More

Day Of Patterns & Practices Screencast - WCSF AJAX DynamicData ASP.NET MVC Framework

The Day of Patterns & Practices Event occurs 1 or 2 times a year in Tampa, Florida. The January 2008 Event provided presentations on the Web Client Software Factory, Web Service Software Factory Modeling Edition, Test-Driven Development ( TDD ) and Model-View Presenter ( MVP ), and the new ASP.NET MVC Framework. This screencast is a quick overview of David Hayden's presentation on the Web Client Software Factory AJAX Guidance Bundles and Composite Web Application Block and their use in ASP.NET Dynamic Data Websites and the ASP.NET MVC Framework.

Read More

ASP.NET MVC Framework and Composite Web Application Block ( CWAB )

The Composite Web Application Block ( CWAB ) in the Web Client Software Factory can be used in the ASP.NET MVC Framework for business module discovery and initialization as well as dependency injection of Controllers. In this quick tutorial I will show you code snippets for doing this from my presentation at the South Florida Code Camp. We will also use the StateValue&lt;T&gt; Class to abstract out the fact that we store our Shopping Cart for our green tea store in Session State. Evolution of the WCSF to use the Unity Dependency Injection Container in Enterprise Library 4.0 would be a natural progression when Enterprise Library 4.0 is released.

Read More

Unity Extensibility Workshop in Redmond - Enterprise Library 4.0 Unity Dependency Injection Container

For you lucky devils in Redmond - Unity is Microsoft's lightweight, extensible dependency injection container. Microsoft patterns &amp; practices will host Unity Extensibility Workshop to walk the participants through the design of Unity container and its extensibility model. You will become familiar with all aspects of the container infrastructure and container extensions: from using existing extensions to building your own. A special attention will be given to the integration of Unity with Enterprise Library 4.0 and the refactored application blocks.

Read More

Unity Dependency Injection Container in Enterprise Library 4.0

Unity will be the name of the dependency injection application block in Enterprise Library 4.0. Unity will be released in two forms - 1) a standalone container, and 2) an application block in Enterprise Library 4.0 with the existing application blocks refactored to support Unity. Unity will support a standard API for retrieving and registering items, a fluent interface, and a ContainerExtension mechanism for third party integration.

Read More

Using Castle Windsor With Repository Factory for IoC

The Repository Factory from Microsoft Patterns & Practices comes with a cool RepositoryFactory Class that maps Repository Interfaces to Repository Classes for a bit of loose coupling in your ASP.NET and Winform Applications. For more robust IoC Services, one could use Castle Windsor to serve the Repository Classes as well as other services in your .NET Applications. Here is an example.

Read More

Topics



Popular Tags



External Topics