I am working on a springboot project where I am working on a feature which require multiple steps (almost like a algorithm). To follow the SRP I have made a separate service class to take care of each step in the algorithm. Now I have situation where my main service class is using up almost 9 other services.
How can I design my classes more better ? I know class which take more than few other service class are violating SRP.
@Service public AlgoProcessor {
// inject service1
// inject service 2
// inject service 3
public FinalReponse startprocess(){
service1.algoStep1();
service2.algoStep2();
// more steps
}
}
Im new in learning design principles, any feedback would be greatly appreciated !