How to re -structure code for single responsibility
Hi I am aware that we should have single class for single responsibility. Refer code "dependency break" and it does A , B and C task which can easily done by three class mentioned in same code example. It was easy as there were no data members. Refer another code "dependency break 2". Here also three tasks are there which I want to break into three classes. But I am confused like what and how to do. First is to Fetch data from other server after authentication, then manipulate data and then write it in the excel file. As it has three responsibility, I thought to split it into three classes. But question and challenge is as below: How to Initialize three class objects ? Should I initialize them into constructor of one another ? Where to store (fetched data from data and structure mydata object in code) between first and second class ? In other words, Should I store data into class fetching it from database or should I store data into class who performs operations? Feel free 2 ask in case of que