Closed olivierobert closed 4 years ago
The parseCSV (read csv file and return all values in an array) and crawl google functions could be reuse multiple times in different places in the app, so i thought one way to make it more convenient and more reusable through out the app is to put them in a Helper
How objects are used should not really defined how they are structured. Also, when it comes to testing having separate classes or modules with related domain make things so much easier.
One of the solution i was thinking of is to create 2 classes: CSV (with readCSV method), Crawler (with getGoogleStat method) so that each object does its own job and there will be separation of concern.
Currently the class
Helper
is the host of numerous and unrelated functionality such as parsing a CSV, removing an empty element in an array (alsoarray_filter
might be of use there) and the Google crawler. So why opting to share all of this in the same class 🤔 ?