Hacker News new | ask | show | jobs
by tipsee 1350 days ago
Hey, thank you for using it. Single-page docs are also my favorite, and Javalin/jdbi/SQLite is my goto for quick stuff!

> but with a very persistent project manager

Your partner? :D

2 comments

Yep! At least they didn't mind when I was drinking on the job.
I can see how DI will be overkill for a wedding website and Javalin/jdbi/sqlite is more than enough but for most business applications written in Java you really wish you had started with DI. Any DI libs you recommend for working with Javalin?
Hard disagree on needing a DI library, manual DI is great.
Disagree on using a lib? cause I guess doing manual DI is still DI.
Yes, disagree on needing a library. The way your comment was worded made it seem to me like you were saying all serious Java applications need a DI library, I'm sorry if I misunderstood you. I prefer doing my ID manually, so no recommendation :)
Could you be more explicit, perhaps with an example? Do you simply mean you prefer function/constructor parameters over DI?
Calling a constructor is DI. ‘new’ is the only DI framework required.

Benefits:

Unbelievably fast startup time

No magic

No annotations, XML or YAML required

No classpath scanning related security vulnerabilities

Conpletely deterministic

In no other language is ‘calling a constructor’ considered so complicated a framework is required.

Try it!

Any DI lib would probably work, it depends on your preferences and use cases though.

I'm personally a fan of Weld since its the reference implementation of the CDI spec.

https://weld.cdi-spec.org/

A friend of mine built an MVC library around Javalin that uses Dagger as the DI container: https://github.com/jehugaleahsa/javalin-mvc