Comparing Design Patterns
Which is better?
OR
For the purpose of this example, all the functions in the first example represent a module i.e a
In the first example, I can call getX and provide
But in the second one, I must always provide
OR
For the purpose of this example, all the functions in the first example represent a module i.e a
RepositoryIn the first example, I can call getX and provide
FeatureService and HttpClient. I can also use some other function in that file that doesn't require FeatureService without providing FeatureService.But in the second one, I must always provide
FeatureService even if the function I need doesn't require it.