Thanks for your advice, Krzysztof - I'll take a look into facility
solution, although the startable concept doesn't look much suitable in
this case. The whole application is a set of Rhino.ETL processes and
operations working in a modular way - default processes and operations
are in core module and I need to have possibility to override these
default implementations (both processes and operations) in child
modules (each of our clients has its own module). That's just to make
the problem description more factual.. The windsor vNext IOC-268
solution would be best IMO, so I'll implement it now in some
workaround-way and use the new IHandlerFilter when new Windsor is
released.

On Jan 25, 12:27 am, Krzysztof Koźmic <[email protected]>
wrote:
> Filip,
>
> as of v2.5 currently there's no way to intercept the call to ResolveAll
> the way you describe.
>
> This has been already implemented for the next version 
> though:http://issues.castleproject.org/issue/IOC-268
>
> As of now the first thing that comes to mind is that your operations
> look like startable components, so you might pretty easily write a
> custom facility that listens to the registration, records the
> information about overrides and then uses this information to resolve
> just the right ones, one by one.
>
> HTH,
> Krzysztof
>
> On 25/01/2011 2:09 AM, Filip Kinsky wrote:
>
>
>
>
>
>
>
> > I have a modular application which works basically in two steps:
>
> > 1. registers all operations from all available application modules:
>
> > container.Register(AllTypes.FromAssemblyInDirectory(dir).BasedOn<IMyOperati 
> > on>().WithService.Select(new[]
> > {typeof(IMyOperation)}))
>
> > 2. executes all registered operations
>
> >     container.ResolveAll<IMyOperation>().ForEach(op =>  op.Execute())
>
> > This works just fine, but I need to add ability to override some
> > default operations in "core" module with some other operations from
> > other modules. I was thinking about using attributes for marking
> > operation classes with should override some other default operations
> > like this:
>
> > class DefaultOperation: IMyOperation{}
>
> > [OperationOverride(typeof(DefaultOperation))]
> > class OtherOperation: DefaultOperation{}
>
> > and than applying my own IHandlerSelector implementation (or something
> > like this) which should resolve just operations which are not
> > overridden. Unfortunately IHandlerSelector.SelectHandler does not
> > allow to return array of IHandler, but just single IHandler which
> > makes this idea impossible. Is there any other Windsor extension point
> > I could use to make this kind of filtering? Or does anybody have an
> > idea how to achieve this concept? I'd prefer some Windsor-based
> > solution. I can always make something like
> > container.ResolveAll<IMyOperation>().Where(is_not_overriden), but I
> > don't like this approach...

-- 
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.

Reply via email to