2

Not sure whether this is the right forum to ask this but here goes.

Using this solution - https://stackoverflow.com/questions/26571351/replacing-if-else-logic-with-state-strategy-pattern I was able to refactor my complex IF/ELSE check statements. One would like to nest this without having to use an external rules engine. In other words

  1. If file exists and data does not contain void read in file else download file from alternate URL and read in file
  2. If zipfile exists and data does not contain void read in file else download file from alternate URL and read in file again
  3. If zipfile does not exist download file and check if data does not contain void else download file from alternate URL and read in file again.

How should I proceed forward? Is the best way by checking for another "Condition" within "Action"?

  • One way to move forward would be to this to "nest" Conditions and associate Actions with "leaf" Conditions. Comments ? –  Nov 18 '14 at 21:02
  • Or to associate a Condition with an array of Actions.If experts agree I can post this as an answer. –  Nov 18 '14 at 21:08
  • Yes it does seem like a duplicate. Should I delete the question ? –  Nov 20 '14 at 02:49
  • http://blog.stackoverflow.com/2010/11/dr-strangedupe-or-how-i-learned-to-stop-worrying-and-love-duplication/ – gnat Nov 21 '14 at 08:28

0 Answers0