Design patterns·The named ways it goes wrong
the class needed an environment variable, a file on disk and the current time, and its constructor took nothing.
Hidden dependency
Also calledimplicit dependency, undeclared dependency
A dependency a component reaches for without declaring, through a global, a static accessor, an environment lookup or a service locator. The cost is discoverability: you cannot tell what a class needs from its signature, so tests fail with errors about things the test never mentioned. Making them parameters is the whole of the fix, and the resulting long constructor is honest rather than worse.