If there are some state transaction situation like below
if(conditionXXX){
state = B;
}
else if(B && conditionYYY) {
state = C;
}
else if(C && conditionZZZ) {
state = D;
}
else {
state = A;
}
Do I have to choose state pattern to resolve this situation than if/else? If yes, why? If no, why?
Aucun commentaire:
Enregistrer un commentaire