mardi 17 décembre 2019

How to reduce too many parameters from constructor

I used 9 parameters to the constructor in a command service class. but sonarqube shows an error for too much constructor. can anyone suggest a solution or design pattern solve this issue?

public CustomerCommandService(A a, B b, C c, D d, E e, F f, G g, H h, I i){
//some code here
}

Aucun commentaire:

Enregistrer un commentaire