30 ms·
Interesting, I hadn't seen that link, thanks. The reflective dependency injection is actually one of the biggest things that drew me to Martini initially. My
by notduncansmith 12y ago
Interesting, I hadn't seen that link, thanks.
The reflective dependency injection is actually one of the biggest things that drew me to Martini initially. My usual Node framework of choice, Bogart, recently added this feature and, having just wrapped up a 2-month project with it, I didn't run into the problem that Jeremy (codegangsta) expressed in that post:
> [..] Martini allows you to inject all the things and that leads to a level of indirection that, while modular, requires a certain amount of cognitive overhead to fully understand what is actually going on.
To the contrary, I actually found that it made me juggle much less in my head. I know exactly where something is being injected (since they all get injected in one place), and I know generally what types of things we inject as dependencies, so the questions "Is this available as a dependency?" and "Should I inject this as a dependency?" are very easy to answer. This makes composing the application (and each route) a much smoother experience.