Blog Archives

Making sure all IWorker implementers call CanHandle from Handle without a mocking framework


You have an interface that allows you to treat all worker classes – classes that handle a specific type of work – as just one type: IWorker;

You want your worker classes to be able to do their work without having to check their backs every step of the way.

Read more ›

Act like a pessimist and call CanHandle from Handle (again)?

You have multiple Worker classes that can each handle a one or more types of command. Your IWorker interface offers two methods: CanHandle and Handle.


Anyone with work to be done can now find a worker that says “yay, I can handle this” and then pass off the work to that worker.

Read more ›

Show Buttons
Hide Buttons