So I'm building a fairly simple file transfer server/client but having a hard time to figure out a good design for processing different commands and states within the protocol..
Say that you have 3 different commands upload
, remove
, download
, you could use 3 different if-statements and keep track of states with additional if-statements, but that wont scale and will be impossible to maintain..
The Chain Of Responsibility design pattern could be used for sequential stuff such as encryption and compression, but it wont take care of the logic for commands.
I know that this is a quite broad question, but does anyone have any suggestions?