3 ms·
When it is done properly it has practically no costs and only benefits. If you start using the container in more than one place, introducing a ServiceLocator pa
by tigershark 10y ago
When it is done properly it has practically no costs and only benefits.
If you start using the container in more than one place, introducing a ServiceLocator pattern, using providers instead of automatic factories then you will pay an high cost.
But in these cases you are doing it wrong.
Doing it properly it helps you to design the whole application correctly and adds flexibility and modularity for free.
As I said, while on a toy project it is a negligible advantage, in a real world project it is an invaluable plus.
- sbov 10y agoNothing is free.