Browse by Tags
All Tags »
Unity (
RSS)
Extensions Another long overdue post on Unity. See the first here for an introduction, the second here for dependency injection and the third here for AOP with Unity. Unity allows adding extensions to it. An extension is something that enhances its functionality...
AOP This is my third post on Unity. See the first here for an introduction and the second here for how to apply dependency injection. Aspect Oriented Programming (AOP) is a technique for applying cross-cutting concerns to existing implementations, without...
Dependency Injection Second part of my series on Unity. For an introduction, read the first post . OK, now we know how to get Inversion of Control (IoC): instead of referencing a particular concrete implementation, we instead reference an interface or...
Updated: ContainerControlled instead of ExternallyControlled in the bullet list of lifetime managers. Thanks, Ross Smith! Introduction Unity is Microsoft’s Inversion of Control (IoC) and Dependency Injection (DI) container. It is part of the Enterprise...
An handler factory is the class that implements IHttpHandlerFactory and is responsible for instantiating an handler ( IHttpHandler ) that will process the current request. This is true for all kinds of web requests, whether they are for ASPX pages, ASMX...
A pooled lifetime manager for Unity. Creates new objects up to a maximum size and returns them in round-robin sequence. Default pool size is set to 5, but you can override it in the appSettings section with a key: <appSettings> <!-- format is...
Unity 2.0 no longer includes CachingCallHandler , as you can see in here . Since this is something I use very often, I decided to bring it back, with some changes: It no longer uses ASP.NET cache, but the new MemoryCache The current process is part of...
With Unity, it is quite easy to implement an extension that automatically sets the appropriate interceptor for each registered type. Here is how I did it: public class DefaultInterceptorInterceptionExtension : Interception { private static readonly IInterceptor...
Update: fixed a bug in the attached code. Enterprise Library comes with several lifetime manager, which you can use to control how your objects are stored and retrieved. The available lifetime managers are: ExternallyControlledLifetimeManager : stores...
In order to have dependency injection on your ASP.NET pages, the best way to go is through a customized page handler factory. A page handler factory is a class directly or indirectly derived from PageHandlerFactory who has the responsibility to create...
More Posts
Next page »