Dofactory.com
Dofactory.com
 Back to list
Views:   6.4K
Replies:  1
Archived

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?

Cheers
Anthony Joanes, Apr 05, 2013
Reply 1
please take a look at  strategy pattern, business rule.

Thanks,
Tarriq
Tarriq Ferrose Khan, Jun 09, 2013
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.