This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-26
Channels
- # announcements (4)
- # babashka (8)
- # beginners (75)
- # calva (26)
- # cider (33)
- # circleci (5)
- # clojure (36)
- # clojure-dev (2)
- # clojure-europe (25)
- # clojure-nl (4)
- # clojure-spec (38)
- # clojure-uk (47)
- # clojurescript (15)
- # cloverage (2)
- # conjure (64)
- # core-async (41)
- # cursive (13)
- # data-science (2)
- # datalog (16)
- # datascript (22)
- # datomic (9)
- # duct (2)
- # emacs (81)
- # figwheel-main (1)
- # fulcro (4)
- # jobs (2)
- # jobs-discuss (29)
- # kaocha (3)
- # meander (11)
- # membrane (21)
- # off-topic (1)
- # portal (1)
- # re-frame (1)
- # reitit (1)
- # releases (2)
- # remote-jobs (31)
- # shadow-cljs (26)
- # specter (5)
- # sql (26)
- # tools-deps (19)
- # vim (12)
Mornin' Happy Hump Day!
Morning 🙂
morning
I have just merged the 3rd PR for my MQTT broker. Someone is actually looking at my code.
Very nice, do you have a link to the repo?
sigh I know not many people here have use of Spring, but I use it quite a bit at work (with my Kotlin adventures). It's okay...until you have to step out of it's walled garden, then it's back to writing reams of code and figuring out the load order of the beans and whether any are being ignored/replaced by your stuff.
What is super simple in Clojure, having a few jdbc connections to a few databases, is non-trivial to do with Spring
what are you trying to do with Spring?
I mostly liked it in a > It doesn't often make me do things I don't want to do kind of way
but that was back on version 2.5.6 Maybe Its Changed
what does it do that makes having a few jdbc connections hard @dharrigan?
going off piste with Hibernate - now that is hardcore
and you don't have to use Spring? Just do it in plain old java
i seem to recall using it back in the day, getting rid of the xml frontend and replacing it with a jruby frontend, and it was quite nice then... but we were moving a mostly java system over to ruby/jruby, so that kinda sorta made sense for us
Well, I'm using JOOQ which is a nice DSL for SQL, you run it against your schema and it generates type-safe classes etc.. Then you can use a fluent DSL to construct your SQL queries. It's supports in Spring Boot for a while now.
So, if you want to have another DB connection to another database, to then merge in data from two different databases, you have to construct your own DSLContext
but, there's this magic "@ConditionalOnMissingBean" on the JooqAutoConfigure on Spring Boot
So you step off the happy path and suddenly you have to grok how the component parts are bolted together
And suddenly you are contemplating a very steep learning curve
Yeah from that point of view I'd agree with you
Clojure has a pretty steep learning curve too of course
The thing, however, with Clojure, is that it has only a few constructs, and the libraries are generally well thought out (i.e., next.jdbc). I can see in front of me how things work and the layer(s) are thin. With Spring, it works really well and it's fantastic for quickly getting something out (for the business that is!) but with lots of magic stuff happening behind the scenes (lots of proxying and annotations), it's all hidden from you, so if you do need to do something a bit different, then you have to delve very deep to see what is going on, then surface again for some air to pretty much DIY.
It feels more natural, more what-it-means-to-be-a-programmer, using Clojure with some libraries, than Spring 🙂
If I can channel Dr McCoy for a moment..."I'm a programmer, not a Spring developer dammit" 🙂
In the early days, clojure.java.jdbc
(nee clojure.contrib.sql
) used a single dynamic Var for the DB connection so it was almost impossible to use with multiple connections/multiple databases too 🙂
It was a very nasty set of breaking changes. I would handle it very differently today.
(I think I made breaking API changes in three releases as I worked on c.j.j)
You know one of the other attractions that I have with Clojure, is it's data oriented approach - just maps, vectors and lists (and a few scalars). It makes shuffling data in and out of a database via an API (which goes on the wire as JSON) so refreshingly easy and simple to do.
yeah, data orientation is definitely one of clojure's superpowers
every time i have to do some data manipulation in java or js i cry a little