2 comments

[ 2.5 ms ] story [ 17.1 ms ] thread
The specification pattern can also be used to replace multiple IFs. If you look at Wikipedia, they propose a quite full-fledged and complex specification pattern, but it is possible to make a more lightweight one for your needs.