The proliferation of if/else/switch statements is a common problem in software systems. The fact that they are replicated in many places is problematic because when such statements are inevitably changed, it is easy to miss some. This leads to fragile systems. It’s the dependency structure that is a worse problem. The solution to this problem is to break those outwards dependencies on the lower level modules. This can be done with simple polymorphism.
15 Impressions