3 ms·
If they were JUST functions they could be static utils and wouldn't need to be beens. But these service classes themselves have their own fields/dependencies.
by therealdrag0 6y ago
If they were JUST functions they could be static utils and wouldn't need to be beens. But these service classes themselves have their own fields/dependencies.
The Service class holds an instance of the Caching class and the Database class, each of those hold an instance of clients with connections, for example.
Can you explain how language support would remove this pattern?
I'm currently working on Scala services, and we don't have any DI, which is actually kinda nice, but it just means we "new-up" all these classes manually in our Main class and pass them through as arguments one to the next.
So far I like how there is no "spring magic"; however, in the end the pattern of dependencies is the same.