Home  /  Questions  /  Question

50   50
Apr 05, 2013

Multiple IF statements and what to replace them with

Hi guys

I've come across a legacy app that has a large number of conditional statements one after the other and just wondered what approach people have used to make this sort of thing more readable.

The code I have checks values in text boxes and if condition is met a method call is done. This happens for about 12 cases.

I'm thinking I can do something with the textboxes as they will have polymorphic behavior, maybe create a separate method to pass them into?


90   96.5
Jun 09, 2013
please take a look at  strategy pattern, business rule.