Hacker News new | past | comments | ask | show | jobs | submit login

Not only it is still around, Spring actually depends on many of the same standards.



This take is so exhausting. It really is, "Tell me that you know little about Java beyond forum comments that you've read, without telling me that you know little about Java beyond forum comments that you've read".

The most important Java EE specifications (now "Jakarta EE", as "Java EE" hasn't existed for years), are: CDI, EJB, JPA, JTA, JMS, JAX-WS, JAX-RS, JSTL, JSP, and JavaMail.

Of that list, a typical Spring Boot application in the wild miiiiiiight use JPA. And that is totally optional, with a handful of newer ORM frameworks seriously eating into its market share. Even JPA itself didn't come out of the "Java EE" world. Hibernate won the ORM wars back in the day, and so the Hibernate folks were allowed to write the JPA spec, making it near-identical to the existing Hibernate API.

Spring has extensions that allow it to interface with nearly anything in the Java ecosystem (and its DI container makes it easy to write an integration to anything new). However, while it CAN interact with all of those Java EE API's, it doesn't NOT "depend" on them!

The story of Spring's relationship to Java EE is the classic "embrace, extend, extinguish". Reddit and HN are able to grasp that pattern just fine when they are slamming Microsoft. However, they can't grasp get it in this context. I honestly believe that the vast majority of people's Java knowledge on Reddit and HN comes from ignorant comments that have been in a self-reinforcing recursive loop for years.


Most Spring deployments I have seen in the wild aren't using Spring Boot as such, rather Spring MVC, and yes they do depend on them on most enterprise shops.

But what do I know, I only took part in the Nokia NetAct from CORBA Perl/C++ into Java EE migration, have done my share of Java projects since then, and nowadays all our projects tend to have a mix of Java and .NET, so guess I hardly see any Java code. /s


> Of that list, a typical Spring Boot application in the wild miiiiiiight use JPA. And that is totally optional, with a handful of newer ORM frameworks seriously eating into its market share

Could you cite some? Specifically any that encourages immutable objects (like records in entities).


For one, Spring offers "Spring Data JDBC", where the Spring Data repositories that people like so much can be implemented with raw JDBC rather than using a full ORM.

Beyond that, there is JDBI (another thin wrapper around raw SQL), jOOQ, and MyBatis. And then a number of other options like Apache Cayenne that are interesting but never really caught on.


Not sure whether it is an ORM, but some people like JOOQ quite a bit.


The best description I have seen is "type safe SQL" and it's a default choice for me too. One of the rare occasions where code generation in a Java library doesn't feel like magic and doesn't require littering your code with annotations.


Yes I heard that, but it has other issues - code generation :( And AFAIR it needs a license for usage with Oracle, and getting approvals for something like that in a corp is PITA.


I believe there's a pretty common approach implied here that assumes that SQL DDL is what you start from. It's nicely aligned with how RDBMS schema changes are usually applied too (i.e. a DDL script to make changes and possibly another to roll them back):

* define you DB schema in a SQL script under version control

* apply the script to your local DB instance, re-generate JOOQ classes (under version control too)

* update the service logic

* commit all the changes

* in prod, apply the script and then re-deploy the code


Code generation is not necessary, just makes it more typesafe and comfortable to use AFAIK.

And yeah, its licensing is basically it is free for open-source dbs, paid otherwise.


Hop on LinkedIn and search for job openings mentioning spring-data-r2dbc, or spring + r2dbc.

Edit: r2dbc being reactive is founded firmly in the idea that you won't be getting proxy objects. I'm more of a vert.x fan myself so I haven't used it personally but I see CVs come by my desk with users of it.


Write SQL and do the mappings to records yourself.


I've never understood why this isn't a more common approach.

JDBC is an old standard, but it's also perfectly functional. The addition of try-with-resources has made it fairly terse once you know your way around it.

And half the time with an ORM, you are trying to figure out what SQL is ultimately being generated and tweaking to get what you want. So, cut that middle layer out and just write what you want.


Yes, tried that once and every other developer in my team complained.

I would stick with JDBC if I were the only developer.


If I have to use something like an ORM, then I push for JDBI or JOOQ. I've not ran into too much pushback using raw jdbc at my current employer though.


Yeah, forgot about JDBI.

Developers are lazy and just throw hibernate everywhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: