mardi 4 août 2015

Refactoring class with a lot of Switches and ifs

I'm dealing with a class which has a lot of switches and ifs. I would like to hear from somebody any advice in order to get the best refactoring. I was thinking if it is possible to use functional programming to avoid to much ifs.

The class has two enums and each enum have at least 8 possibilities. So, the logic is based on returning an enum depending on switch-if-else structures.

Thanks in advance!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire