Interception in Unity 1.1

Jul 2, 2008 at 2:01 AM
Are there any plans to add Interception to Unity? There is an extension in unitycontribs, but it seems like it only works with Unity 1.0.

Jul 2, 2008 at 5:25 AM
Yes. We're planning to take the basic design of PIAB, plus add the codegen based interception stuff Scott & Brad did for ObjectBuilder 2. We should be starting work on it in a couple of weeks.

Jul 4, 2008 at 3:57 AM
Codegen? So if I want to add a new interceptor (say a performance counter interceptor to wrap a method invocation with counters) I have to recompile my application? Can you provide any more details on this?

Jul 4, 2008 at 6:49 PM
It's dynamic on-the-fly codegen, no recompile required.

If you want to look at where we're starting from, check out the interception stuff in the Codeplex ObjectBuilder project. Unity's version of OB is different, but we're shamelessly stealing everything we can.

Jul 6, 2008 at 3:24 AM
Chris -

Thanks for the response - most appreciated. I'll be sure to check that out so I can get a feel for where you're heading... I've been looking into Autofac lately - and here's what I'm staring at to wire up an interceptor:


My only request is keep it simple :)