Hello,
I've been working on IInterceprorSelector support implementation in DP
for last couple of evenings. I have working implementation to some
extent, there are however some things I'd like to get your opinions on.
1. To what extent the return value of
IInterceptorSelector.SelectInterceptors should be checked?
a) No check at all. This will yield NullReferenceException, but it's
implementors duty to implement it correctly.
b) Only check for null, and if it is null, treat it as if empty
array was returned.
c) Extensive check, including checking if returned IInterceptors are
a subset of array passed to the method.
Personally I'm leaning towards option b.
2. Should the calls be cached, ie SelectInterceptors should be called
only the first time a method is called for an instance, or should it be
called everytime?
3. What to do when empty array is returned for proxy without target? We
can't call target method then. Should the method just return default(T),
where T is the return type of the method, or should it throw an exception?
4. How should Selector and cached interceptors be handled during
serialization? Selector should be serialized IMHO as it is important
part of class' state, what about cached per-method interceptors? Should
they be serialized as well,
or should we just leave them out. When the class gets deserialized, the
selector will pick them up again anyway.
5. Should we remove UseSelector property on ProxyGenerationOptions. IMHO
it's confusing, and it can be assumed that if Selector!=null, it is
there to be used.
That's all I can think of now. If you have any other topics I didn't
bring up here, please speak up.
Thoughts?
For those interested, my current implementation has all the features I
could think of, except for serialization support. It is not in the
repository, since I'm not a commiter, but when I'm feature-complete I'll
create a patch and put it in Donjon.
Cheers,
Krzysztof
http://kozmic.pl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---