Hidden Dependency

noun

say it: “HID-un dih-PEN-dun-see” /ˈhɪdən dɪˈpɛndənsi/

Something a class needs in order to work that its constructor doesn't mention.

What is a hidden dependency?

A hidden dependency is something a class needs that you can't see from how it's made. new Checkout() looks like it needs nothing, but inside it reads a shared settings object for the tax rate. Asking for it in the constructor, new Checkout(settings), makes it visible.

In a sentence

  • “new Checkout() looked simple, but the shared settings it read inside were a hidden dependency.”

Level: Journeyman · More Software Development terms at this level

Updated