jeudi 12 février 2015

Good architecture for one if statement with many conditions

I have an if statement which looks like this:



if conditionA() || conditionB() || conditionC() || conditionD() || conditionE() || condition()
#do sth
end
#conditionX() methods return true/false


This looks ugly. Is there any design pattern which would simplify this?


Aucun commentaire:

Enregistrer un commentaire