Share via


Extending and Modifying the Unity Application Block

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

If required, you can extend and modify the Unity Application Block to better suit your own requirements. You can extend the Unity Application Block by doing the following:

  • Creating Lifetime Managers that control how and when the container will dispose instance of objects.
  • Using Container Extensionsto change the behavior of the container, the instance generation, and the dependency injection features.
  • Creating Container Extensionsthat provide your own custom container behaviors.
  • Creating a New Matching Rule that provides alternative techniques for selecting classes and class members to which the Unity Application Block will attach a handler pipeline.
  • Creating a New Handler that performs the task-specific processing you require for specific method invocations and property accessors.
  • Creating a New Handler Attribute that causes the application block to add built-in or custom handlers to the handler pipeline. If you create a custom handler, you may want to create a custom attribute that developers can use to apply your handler by adding the attribute directly to classes or class members within the source code of an application.