Tuesday, March 9, 2021

Re: New Article "10 Best Java Frameworks to Use in 2021"

We are using .Net in our backend with NHibernate and i must to say that using Linq To Sql is very helpful and let you have all queries strong typed. We also have  to mantain a small part of queries with ado directly due to performance.

I don't think using something like Hibernate would be bad nowadays If Java could have something like Linq to Sql (maybe something like jOOQ).

PD: God save flame wars!!! 

El martes, 9 de marzo de 2021 a las 10:34:18 UTC+1, lofid...@gmail.com escribió:
@TBroyer: of course we are going to start a flame war for Hibernate ;-)

"Hibernate" is the most searched word in Google 2021... OK, I mean "how to hibernate your PC" :-)

I agree with @Gordan, it depends on the use case. Strangely enough, we have today ORM also on Android Room (https://developer.android.com/training/data-storage/room) and iOS Core Data (https://developer.apple.com/documentation/coredata). So from the resources and speed point of view, it seems that they are just fine.

Actually it's a pitty that the standard SQLJ (https://en.wikipedia.org/wiki/SQLJ) did not get any further, I think it would be a good choice if you need SQL but need the "type and compile time" safety in Java.

Cheers,
Lofi
Gordan Krešić schrieb am Dienstag, 9. März 2021 um 09:11:06 UTC+1:
On 09. 03. 2021. 08:29, Craig Mitchell wrote:
>
> Too late.  Flame war!  ;P  But seriously, what's wrong with using Hibernate
> as JPA provider?  Okay, yes, there is nothing to learn, it does all its
> magic behind the scenes, but is there something better?  Or maybe using JPA
> is bad, and we go back to pure SQL?  I'm curious.

I did try various ORMs, including some for non-relational databases (but
then it's not an ORM, but... what?) but never figured out the benefits. They
all demo well, but when I go past most basic usage, they always felt more
like an obstacle than a tool.

Only case where I would agree using ORM saves time are projects with high
number of tables compared to complexity of their usage (simple SELECTs on
hundreds or thousands of tables). But, I don't have such a project in my
portfolio.

Can you name few other benefits? Type safety? "Compile-time checks" of SQL
"queries"? I can see *some* benefits there, but hardly ones that justifies
learning another, fairly complex, DSL on top of SQL.

From time to time I found a survey with question like "Which ORM do you
use?" and there are usually low-double-digits of percentages of users who
claim to be using "raw JDBC with SQL". It gives me hope that I'm not a lone
lunatic, but still, 80+% of users must know *something*, right?

So, if we assume that someone already knows SQL (and it's an 'if', I know),
what would be the benefits of using ORM of any kind?

Bonus question: I've been looking for years for a most simplistic SQL
templating library, mainly for things like reusing WHERE clauses (i usually
end up with fairly complex ones used in multiple queries), linking '?' with
setters on PreparedStatements and things like that. I even wrote small lib
because I was tired of experimenting, but I seriously doubt that I'm the
only one with this need and would instead like to contribute to already
existing project rather than maintain my own.

-gkresic.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/c4655882-aab3-4950-b424-412cc5aa9b38n%40googlegroups.com.

No comments:

Post a Comment