4 ms·
Takeaway: Representing dependencies explicitly in code will avoid you lots of trouble. One way to achieve that with an object of type X that requires an object
by Hexstream 18y ago
Takeaway: Representing dependencies explicitly in code will avoid you lots of trouble. One way to achieve that with an object of type X that requires an object of type Y is to require an y in the constructor for x's.
- sh1mmer 18y agoMaybe I'm being slow, but I didn't get how they were explicitly declaring it except in the test, and I don't see how one test in a whole suite would help a newbie discover this problem. Are they actually implying the constructor should throw an exception moaning about lack of X dependency?