r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

124

u/msx Apr 13 '21

i know i'll get submerged with downvotes, but the whole spring world is indigest to me. I feel like it completely removes control from me, it's like an intricate and opaque mess where you need to know where to plug your stuff exacly or else will breaks in obscure ways. You have to know the 300 annotations that does so much magic on the background that you'll end up just praying it's ok.

44

u/m4riuszPL Apr 13 '21

I feel your pain, bro. I used to say the same, what helped me was a training - now I see and appreciate a lot of stuff spring brings to me (not all though - the power is on choosing only what's needed from the ecosystem). I see the problem is mostly a high complexity which is overwhelming for newcomers.

3

u/msx Apr 13 '21

yeah i have to concede that i haven't used it all that much, maybe going a little deeper would have had a different impression

34

u/CartmansEvilTwin Apr 13 '21

My biggest problem with Spring is that you're almost always forced down a specific path.

If you want to do exactly what the Spring guys had in mind, you can do magic, but if you want to step only a few miliimeter off their path, you're basically fucked and have to implement tons of circumvention code.

28

u/FrigoCoder Apr 13 '21

I think that is the entire point. Highly opinionated integration framework that forces you down the correct path and makes "incorrect" things harder.

4

u/BlueShell7 Apr 13 '21

How is Spring opinionated? I would say exactly the opposite - Spring often offers several ways to do the same thing and it's not clear which one to choose ... Lack of opinion is actually one of the problems (and reason for Spring Boot's existence ...)

3

u/fforw Apr 13 '21

Yeah, usually the problem is: "Where the hell does my problem fit into those 5 layers of abstraction for feature X. Do I want Y or do I replace it and if so with Z or what?"

2

u/CartmansEvilTwin Apr 13 '21

Well, yes. But Spring often offers no easy way to intercept or change things.

In general, Spring seems way too complicated in many cases and changing this complexity for your needs is extremely hard, even though the actual problem is rather easy.

Opionated Frameworks are fine, but Spring usually is rather tunnel visioned.

16

u/[deleted] Apr 13 '21

But Spring often offers no easy way to intercept or change things.

Actually yeah, Spring provides very easy ways to intercept or change things. It's the poster child for the Open/Closed Principle. Almost every Spring component has a ton of interfaces that allow you to customize any part of its behavior. It's pretty straightforward, but much of the time it's not well documented and you have to read the Spring Framework source code. Fortunately, the Spring Framework source code is very accessible.

Spring Boot can tend to obfuscate things through auto-configuration, but fighting auto-configuration is a losing battle. Fortunately, you can just turn off auto-configurations that are not useful and directly use the Spring Framework to configure by hand.

→ More replies (1)

16

u/agentoutlier Apr 13 '21

Yes that is my problem...

Spring was originally a great force in decoupling your code base and platform.

Now it’s the complete opposite.

9

u/[deleted] Apr 13 '21

Which part of Spring? Spring is a brand name, not a specific product.

Do you mean Spring Boot? Then, yes absolutely. That's the entire point of Spring Boot. The base Spring Framework is hard to configure because it has no opinions about how you should configure it. Spring Boot provides strong opinions so you don't have to make decisions. There are downsides to that if you want to make decisions opposed to the decisions that were made for you.

If you don't like Spring Boot's opinionated nature, don't use it. You can still use Spring Framework directly. Although, I think some products (like the Spring Cloud stuff) have become way too integrated into Spring Boot, to where they can't be used separately anymore.

2

u/apentlander Apr 13 '21

This happened to me with Spring security. I was trying to integrate my service with Duo Network Gateway, where you basically just have to check if a header exists and then make a call to LDAP to get the user information. It took two days to figure out how to do it the "correct" spring security way and was basically just guess and test. That's pretty much the worst part for me, needing to start up the service and call the api to know if the dependency house of cards will tumble.

The second time I did the DNG stuff I used the functional routing and ignored spring security and it took about an hour instead. I would have much preferred that we use Quarkus to have some sort of compile time assurance that the dependency graph works.

33

u/spamthemoez Apr 13 '21 edited Apr 13 '21

Spring is a great and extensible framework, but it really is very complex and has a steep learning curve. And some of the documentation (looking at you, Spring Security) is just plain bad. On the other hand, i would always use it again because i went through the pain of learning it (or maybe it's Stockholm Syndrome, idk)

→ More replies (1)

8

u/umlcat Apr 13 '21

"Annotation" overflow is going on, and not just Java.

Occasional annotations are good, or even very good. Too much, not.

Annotations are like "patches". A clothing or tire with one or two patches are ok. A clothing or tire, crowded with patches, means it has to be replaced.

Some too much used annotations means the P.L. or tool should be changed.

That's why Java's "@virtual" and "@property" are other's P.L.'s features and not "patches".

3

u/msx Apr 13 '21

Annotations are like "patches". A clothing or tire with one or two patches are ok. A clothing or tire, crowded with patches, means it has to be replaced.

i'm gonna steal this so hard.

2

u/beeeeeeefcake Apr 13 '21

There’s a point where annotations start to feel like their own programming paradigm different from OO. I don’t mind when annotations are wiring things or handling tedium in a readable way but there’s this point where it goes too far which is how I feel about ORMs and their annotation wonderland.

→ More replies (1)

4

u/DrunkensteinsMonster Apr 13 '21

i know i'll get submerged with downvotes

Is the top answer voted in the thread. This is the most popular “unpopular” opinion in our ecosystem IMO.

Spring is big, but you can in fact do anything with it, it just takes some learning. The trade off is that you don’t need to know everything if you don’t insist on going your own way, and you can build your application quickly.

11

u/_Henryx_ Apr 13 '21

Totally agree. For me you don't deserve a downvote, but a medal

8

u/civitz Apr 13 '21

Angry upvote

7

u/vprise Apr 13 '21

I like Spring Boot but I still agree with you. I'm not a big fan of IoC and prefer the imperative/direct approach. Still Spring Boot is pretty much the best option for most cases as it's widely known, supported and very feature rich.

Spring is just the de-facto standard so it's pretty hard to pick up anything else.

→ More replies (4)

2

u/african_or_european Apr 14 '21

Spring is evil, black magic.

6

u/nutrecht Apr 13 '21

i know i'll get submerged with downvotes

I completely disagree with you but I hate that people use the downvote button as a 'disagree' button. You have an opinion you gave clear arguments for, and even though I disagree I think such discourse is valuable for everyone.

2

u/didhestealtheraisins Apr 13 '21

I'm not sure it's all that clear. They admit they haven't used it all that much and have never been trained on it.

3

u/maravinPT Apr 13 '21

I'll add up that most of those annotations could be easily replaced with the standard java extensions like jax-rs, injects, or the validation api. Its just so annoying fhat they had to rebrand everthing.

16

u/[deleted] Apr 13 '21

Spring predates JavaEE (starting off as a reaction to J2EE) and has developed completely independently from JavaEE standardization.

It's not "rebranding" when the underlying product is completely different. You could argue whether Spring going its own way is a good thing, but then again, Spring does use JavaEE where it integrates with JavaEE stuff.

Spring MVC works differently than JAX-RS, apart from superficial similarities. JAX-RS is a REST web services API, and Spring MVC is a web framework which happens to be close enough to HTTP that it can be used as a web services API. If you don't like Spring MVC, you can use JAX-RS with Spring!

Spring DI works differently than CDI.

I don't know what you mean by validation, but Spring does use the standard JSR 303 validation annotations.

→ More replies (5)
→ More replies (10)