7 ms·
I just wanted to say thank you for your work. The straightforward docs are some the best in my opinion when you want to go from "How do I do ..." to answer. I
by iammiles 4y ago
I just wanted to say thank you for your work. The straightforward docs are some the best in my opinion when you want to go from "How do I do ..." to answer.
I ended up using Javalin with Kotlin and SQLite to build my wedding website.
Most of my projects are lucky to see the light of day, but with a very persistent project manager and a simple lightweight framework, I was able to ship a fantastic product with very little fuss.
- tipsee 4y agoHey, 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
- iammiles 4y agoYep! At least they didn't mind when I was drinking on the job.
- Scarbutt 4y agoI 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?
- tipsee 4y agoHard disagree on needing a DI library, manual DI is great.
- Scarbutt 4y agoDisagree on using a lib? cause I guess doing manual DI is still DI.
- tipsee 4y agoYes, 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 :)
- mkingston 4y agoCould you be more explicit, perhaps with an example? Do you simply mean you prefer function/constructor parameters over DI?
- erpellan 4y agoCalling 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!
- therealdrag0 4y agoIt took me a hot moment to adjust after leaving classic spring Java land to a Scala shop that doesn’t use DI framework, but now I love it. I agree with what you said. It does help to keep services small so the manual DI arg passing doesn’t get too spread out and boilerplate-y. But I have worked on a dozen services here and don’t miss an automatic DI framework.
- coverj 4y agoI have a few questions about this approach, cards on the table I mainly deal in C# where DI (through the framework) is the default. How do you manage the initialization of all of the dependencies? Do you need some sort of "root" where everything is initialized and passed in? That was all I could come up with while keeping it testable and that doesn't sound maintainable once you build up the number of dependencies.
- vips7L 4y agoAny 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/ 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 https://github.com/jehugaleahsa/javalin-mvc
- peanut_worm 4y agojust wondering, what did you use SQLite for on a wedding website?
- samatman 4y agoFor a website, the question should be why not use SQLite. Given the various compelling and (by now, here, I hope) well-understood advantages, it should be the default choice. Certainly for a site expecting hits in the mid-hundreds, total. Maybe ten simultaneous connections the day of?
- NikolaNovak 4y agoInteresting, I interpreted the question completely differently, i.e. why use database at all? FWIW, I'm not in the web app world, so my wedding website was a single page HTML; not a single page app, let alone a content management system - I googled something like "Wedding page HTML template", then grabbed a HTML template from w3schools, opened it in notepad, and put my own words and IMG tags. It looked pretty, was "responsive" by default, took very little time to create, and worked solidly. I'm sufficiently old school / ignorant / pragmatic / lazy / focused / something, to wonder why complicate a wedding page with anything else :-) (I mean, I'm old and ignorant and simple enough that I keep misinterpreting what "static site generator" is :P )
- Scarbutt 4y agoInteresting, I interpreted the question completely differently, i.e. why use database at all? Maybe the wedding page has forms, needs to store data and author is most familiar with Java or maybe they are getting creative and are calling third party services for convenience, lots of reasons. A simpler solution could be nginx/cgi and a local file for the DB, or cloudfare workers(you can render HTML from them) and their key/value storage.
- peanut_worm 4y agoYeah that was what I meant but everyone else seems to be commenting except the person I was replying to lol. I am not attacking databases I am just wondering what they used it for on a wedding website.
- asadawadia 4y agoFor anyone who wants to get started with this stack you can do `git clone https://gitlab.com/asad-awadia/kotlin-server-app.git https://gitlab.com/asad-awadia/kotlin-server-app.git` to get a full maven project with javalin, sqlite with ktorm and jdbi everything setup