News for hackers. Stuff that matters.
Re:You probably don't need a dependency injection framework by surgical_fire on Monday May 26, 2025 @04:30AM (#44095262)
> If you can't monkey-patch the getDate function with a mock in a testing context because your language won't allow it, that's a language smell, not a pattern smell.

Of course you can do it in Java. But it is widely considered poor practice, for good reason, and is generally avoided.

Re:You probably don't need a dependency injection framework by shadowgovt on Tuesday May 27, 2025 @12:42PM (#44108561)
Interesting. Why is it considered poor practice to monkey-patch getDate for testing purposes in Java?