samedi 18 janvier 2020

For same representatoin/output but process slidely different, should I use builder patters?

My api have different params. Based on different api parameters I have two slidely different process. But output almost same. Should I use builders pattern ?

For example, query param A & B

// For case A:

if (A){
  funX();
  funY();
  funZ();
}

// For case B :

if(B){
  funW();
  funX();
  funY();
  funZ();
}

Aucun commentaire:

Enregistrer un commentaire