On 3/10/2010 9:59 PM, Simone Busoli wrote:
inline
2010/3/10 Krzysztof Koźmic <[email protected]
<mailto:[email protected]>>
you put interceptors in whatever order you please.
how?
You create the array yourself in the selector. You choose what to put
there, and in what order. it doesn't even have to have anything in
common with componentModel.Interceptors collection
between selectors order of selectors transfers to order of
interceptors. Plus I think you should not have multiple selectors for
one model so it's a non-issue anyway.
why? I'm using multiple selectors to apply different and unrelated
concerns to models. Do you think I should centralize a bunch of
unrelated stuff into the same class?
Give me a scenario. But despite of it, doesn't order of selectors give
you enough control?
in addition I'm against passing interceptors selected by one selector,
to subsequent selectors.
this is the current code. how do you apply order? how do you remove
interceptors?
foreach(IModelInterceptorsSelector selector in selectors)// selectors
are asked in order you register them in
{
InterceptorReference[] interceptors = selector.SelectInterceptors(model);
+ if (interceptors == null)
+ {
+ continue;
+ }
+
+ foreach (InterceptorReference interceptor in interceptors)
+ yield return interceptor; // interceptors are returned in order
selector put them in the array
}
+
+ foreach (InterceptorReference interceptor in model.Interceptors)
+ yield return interceptor;
}
2010/3/10 Simone Busoli <[email protected]
<mailto:[email protected]>>:
> Except that I don't agree with this principle, the return value
doesn't let
> you specify where exactly to put the interceptor. So the return
value
> provides a subset of the functionality provided by the input
collection.
>
> 2010/3/10 Krzysztof Koźmic <[email protected]
<mailto:[email protected]>>
>>
>> void methods should not modify their arguments
>
> --
> You received this message because you are subscribed to the
Google Groups
> "Castle Project Users" group.
> To post to this group, send email to
[email protected]
<mailto:[email protected]>.
> To unsubscribe from this group, send email to
> [email protected]
<mailto:castle-project-users%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>
--
You received this message because you are subscribed to the Google
Groups "Castle Project Users" group.
To post to this group, send email to
[email protected]
<mailto:[email protected]>.
To unsubscribe from this group, send email to
[email protected]
<mailto:castle-project-users%[email protected]>.
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Castle Project Users" 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-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" 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-users?hl=en.