Hacker News new | ask | show | jobs
by tonyarkles 672 days ago
Mostly that the whole annotation-based dependency injection part can be a mess to debug and that it seemed to (at the time, unsure about the present) have very odd defaults around logging.

The annotation-based DI seemed to do a really good job of turning what should have been a compile-time error into a runtime exception instead.

1 comments

> Mostly that the whole annotation-based dependency injection part

Right, but DI isn't Spring specific, so point still holds.

Within Java there are plenty of other annotation frameworks...

In other languages there are annotation usages and sometimes EVEN worse behavior exists...

And yet for reasons I'd like to know people aren't blaming those (at least not in the same capacity). That's the crux of the issue.

I'm explaining why I have had a bad experience with Spring. Spring is the only framework I've used that does weird stuff with annotation-based DI and can silently fail in production by default due to those annotations not being resolved correctly at runtime (heck, even if they can't be resolved at compile-time, please make them fail at startup instead of later!).

I've had other issues with other non-Java frameworks too, but I'm not giving a comprehensive write-up of the pros and cons of every web framework I've ever used here... just pointing out the pain points I had with Spring.

I also didn't mention LOMBOK because that doesn't seem like it's necessarily part of Spring by default but wow did that also prove to be another source of painful bugs.

Spent a good day debugging, to learn that some (most?) annotations don’t work when the method is called from inside the same class (no proxy is setup).