Imagine you have a list of Objects - like a list or array of objects representing users - and two processors:
- one adds/delete/modify some user under certain circumstances
- the other does the same thing by checking other conditions
circumstances/conditions are verified by taking advantage of other classes/services etc, which are injected when they are instantiated.
I want an architecture that allows me to add/remove processors with ease. I guess a decorator is quite good for this kind of job, but maybe a bit stiff when it comes at dynamically adding/removing processors at runtime.
Another idea is using something like a chain of responsibility, but letting each processor modify the list. I don't know if a kind of pattern like this exists or if it's a bad practice for some reason.
Let me know what you think :-)