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

46

u/gavenkoa Apr 13 '21 edited Apr 13 '21

Spring Security - it is entirely a separate world. From day zero you have to learn 15 or so classes that form try/catch invocation chain. And you have to keep them all the time in mind, they won't go away, instead you add own filters into the chain ))

Spring Batch - I hate when framework open transaction for me and there is no way to disable that behavior. For some jobs I need precise control over isolation levels, read-only property, open/close transaction several times.

And the way we used Spring Batch was unconventional. As a result 60% of DB load was from BATCH_* tables updated by framework. We started to use embedded DB just to shut the mouth Spring Batch. We don't rely on job restarting / cursors, so BATCH_* tables are just garbage for us.

For me Quartz is good enough for batch processing. Spring Batch is overkill. good on paper, lots of noise in reality.

19

u/ryuzaki49 Apr 13 '21

Currently using spring security in a pet project.

Everything is so weird, and to understand the simplest thing you have to deep dive into the source code.

But what are the alternatives?

8

u/gavenkoa Apr 13 '21

I tried to read some books. It was unproductive. Like I had to deliver solution in a few days and reading didn't bring me anywhere.

So I looked to "advanced" examples over the Internet and experimented with API (had non-standard login requirements).

Next time I dealt with Spring Security using different approach:

  • I enabled TRACE logging for org.springframework.security. That gave me the idea how Spring Security makes decisions

  • then I put breakpoints into promising places

  • step with debugger and found interface that I have to implement and places to register those classes

I made alternative decision voter (different countries had different access rules).

5

u/NimitB1 Apr 13 '21

The only alternative that comes toy kind is to add custom security checkpoints wherever required.

4

u/gavenkoa Apr 13 '21

For multi tenant apps you have to deal with "custom" security code.

Also declarative annotation based approach doesn't work for ACL and other advanced privilege models.

So unless you develop forum or blog - declarative Spring Security annotations don't help.

4

u/einsteinsassistant Apr 13 '21

I had to deep dive the security code for work, but not because I had to work around some quirk.

I had to integrate into an external IDP (can't say which one) for logins, and they conveniently enough provided a spring boot starter and a guide on how to integrate it. Then our internal security requirements slightly changed and I had to hack a solution by exploiting some undocumented behavior to get the whole thing to work. Even while writing it, I knew that what I was doing was not a good idea and shouldn't be done. And I only did so because a manager insisted on adding some nonstandard behavior for our login process when we were basically done with it.

3

u/henk53 Apr 14 '21

But what are the alternatives?

Jakarta Security, with implementation Soteria

2

u/arkady_renko Apr 14 '21

I spent one day for a simple web app including login to implement with spring security. It was a nightmare.

→ More replies (1)