I am in the process of refactoring a Java application that accepts commands from terminal. Currently, there is a huge if-else structure that checks for the command issued and executes the required method. I was wondering if it was possible to replace this logic with a well established design pattern. I looked at Command pattern and Strategy pattern, but cannot seem to get my head around it in this scenario. Please suggest.
Aucun commentaire:
Enregistrer un commentaire