avoiding type switching
If you're in a team and a programmer gives you an interface with create, read, update and delete methods, how do you avoid type switching? Quoting Clean Code A Handbook of Agile Software Craftsmanship: public Money calculatePay(Employee e) throws InvalidEmployeeType { switch (e.type) { case COMMISSIONED: ...