• Krakaval@jlai.lu
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 months ago

    Can we talk about annotations which are broken when you upgrade spring boot ? You are asked to upgrade some old application to the newest version of spring boot, application that you discover on the spot, the application does not work anymore after the upgrade, and you have to go through 10 intermediate upgrade guides to discover what could possibly be wrong ?

  • Mikina@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    My favourite take on DI is this set of articles from like 12 years ago, written by a guy who has written the first DI framework for Unity, on which are the currently popular ones, such as Zenject, based on.

    The first two articles are pretty basic, explaining his reasoning and why it’s such a cool concept and way forward.

    Then, there’s this update:

    Followed by more articles about why he thinks it was a mistake, and he no longer recommends or uses DI in Unity in favor of manual dependency injection. And I kind of agree - his main reasoning is that it’s really easy for unnecessary dependencies to sneak up into your code-base, since it’s really easy to just write another [Inject] without a second thought and be done with it.

    However, with manual dependency injection through constructor parameters, you will take a step back when you’re adding 11th parameter to the constructor, and will take a moment to think whether there’s really no other better way. Of course, this should not be an relevant issue with experienced programmers, but it’s not as inherently obvious you’re doing something potentially wrong, when you just add another [Inject], when compared to adding another constructor parameter.

  • Riley@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    7 months ago

    As an audio engineer, I was very confused about what this had to do with Direct Injection for a second.

  • Lmaydev@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    I love dependency injection personally.

    I managed to completely change how YARP routed requests by registering a single interface.

    The flexibility it provides is awesome. And it makes testing so much easier.