Need Guidance on Extensions and EntLib CallHandlers

Dec 3, 2010 at 1:53 PM

Hi there
I use to have some Unity container extensions and custom call handlers for unity 1.2(excpetion handling).
Now i am confused about all the options with unity 2 and entlib call handers so i will start the discussion by saying what i need to do and go from there:

- For unity 2.0 the aproach for creating extensions is the same for unity 1.2?
- How to i efectivly use exception app block call handlers without using attributes on the business layer?

Where can i find good examples of this?

Dec 4, 2010 at 5:53 AM

Yes the basic approach for creating extensions is the same. Some of the specific details (like the removal of the Locator from the build context) has changed, but extensions, strategies and policies are all still there and all still work the same way.


When you say call handlers, are you talking about policy injection call handlers, or are you talking about exception handlers through the exception block? I'm a little confused on the context there, could you clarify the second question?


Dec 5, 2010 at 2:47 PM

Hi there

Thaks for the answer

I´m talking about exception handlers through the exception block, because if they exist then i´d rather take advantage from them instead of wrinting my own. In fact i am trying to use validation call hanlders too, to provide for some basic BLL validation(not null validators on domain entities in my business methods).  My purpose is to use them without having to put the attribute on every BLL class, unless i can use the attribute on my BLL base class, witch will only contain properties for dependencies. That is my "real" question.

As i have read in another post PIAB call hanlders are still there for backward compatibility, isn´t that right?


Thaks again

Dec 9, 2010 at 9:35 PM

There's exception handlers (configured in the Entlib Exception Block)  and there's call handlers, and they are two separate things. It looks like you're talking about the Exception Call Handler. Am I correct? The PIAB call handler stuff is still there and will be for a long time.

You can use either PIAB configuration or the container configuration or container API to set up interception and call handlers. Have you looked at the documentation or the Interception Hands-on-lab (part of the Entlib HOL package)? Attributes are only one way to specify which call handlers run.