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<IMyOperation>().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