InjectionMethod and the order of method calls in dependent object?

Mar 11, 2008 at 7:10 PM
Edited Mar 11, 2008 at 7:34 PM
Is there a way to control the order of method calls in dependent object when it (dependent object) contains more than one InjectionMethod attribute?

To be more specific, do you have any plans to extent this (InjectionMethodAttribute) in such a way that it could be possible to provide the execution order or should I create my own MethodSelectorPolicy that would handle it?

Regards,
Alexander
Mar 11, 2008 at 8:15 PM
We have no plans to do the ordering, so feel free! I'd love to see some community stuff like this written.

-Chris
Mar 11, 2008 at 9:00 PM
Edited Mar 25, 2008 at 12:53 PM
Chris,

This is relatively fast to do so I will add this to my to-do list and hit this item on next week. Do you have contrib site for unity defined?

Regards,
Alexander
Mar 25, 2008 at 12:56 PM
Edited Mar 25, 2008 at 12:59 PM
I have been spending sometime on this and best approach to move on and get it done. Just for my own sanity I need to verify IMethodSelectoPolicy interface:

DefaultUnityMethodSelectorPolicy allows override CreateResolver method. Where-as (OB2) SelectMethods/MethodSelectorPolicyBase does not allowed to be overridden in derived classes.

I could always write a new version of IMethodSelectorPolicy which would allow SelectMethods to be overridden in derived classes. This option would make the coding easier for this extension but currently there are no contrib. guidelines and not sure if I should take this path.

Question: Are there any reasons why SelectMethods in IMethodSelectorPolicy is not allowed to be overridden in any derived classes?

Regards,
Alexander
Mar 25, 2008 at 6:28 PM
I'll mark those methods as virtual. You're right, they should be overrideable.