Blog

Time to refactor the IJob interface and JobDispatcher class

The JobDispatcher and the Jobs are a nice architecture because they follow two important principles of OO design, separation of concerns and inversion of control:

  • The jobs only do their job.
  • The jobs yield the responsability of decided where and when they should be executed to the dispatcher.
  • The dispatcher only decide where and when the job should be executed.

To go even further with the inversion of control, we could...

Read more

IComparable & IComparer

In most cases, comparing two instances of the same time is considered to be an intrinsic feature of the type. This is true for int or DateTime. But what about a Person? Should we compare the Name or the DateOfBirth?

This is when the Comparer becomes handy. You can create one on your type for each scenario.

Read more