Would it be better practice to remove the selection logic from the ExchangeRatesServiceProvider class and move it into an ExchangeRatesProviderFactory class, just having the service provider instantiate the factory and then allow the factory to determine what to return?
Hi Jason, that's a very good question. To be totally honest, I'm not sure which of them is the better practice. But I think that both approaches would be more or less doing the same thing, so my initial guess would be that it would be up to personal preference 😄
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Would it be better practice to remove the selection logic from the ExchangeRatesServiceProvider class and move it into an ExchangeRatesProviderFactory class, just having the service provider instantiate the factory and then allow the factory to determine what to return?
Hi Jason, that's a very good question. To be totally honest, I'm not sure which of them is the better practice. But I think that both approaches would be more or less doing the same thing, so my initial guess would be that it would be up to personal preference 😄