vendredi 5 juin 2020

How to decouple dependencies if we don't use Dependency injection

In one of Bob Martin's presentations about clean Architecture, he says, We shouldn't have hundred of injected classes and the number of injection are normally around a dozen.

If we should't use DI for all classes, how can we decouple classes and Unit test them ? Even if we use factory method, we still need to instantiate the factory and pass it to the class somehow?!

Aucun commentaire:

Enregistrer un commentaire