r/javahelp • • Dec 08 '20

Popular Java frameworks worth learning ?

For people that have been using Java in a work environment or that are looking for employment , What java libraries should I pick up as a recent graduate ?

17 Upvotes

30 comments sorted by

•

u/AutoModerator Dec 08 '20

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions

  • You include any and all error messages in full

  • You ask clear questions

  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

13

u/wildjokers Dec 08 '20 edited Dec 08 '20

If you want a job you need to learn Spring. Love it or hate it, you have to know it if you want a job.

Need to read the doc for Spring Core, then Spring MVC, then you can read doc for Spring Boot, which is a configuration framework for Spring. Yes, Spring is so bloated and complicated that the Spring framework needed a framework for configuration.

Spring consists of many libraries, once you read doc for core, mvc, and spring boot you can then read about the other libraries as needed. Most likely you will need Spring Data at some point.

I recommend you read the reference doc for Spring Core in its entirety. You need to understand spring core to understand everything else. It can make for dry reading and you may not understand it all. But that is ok, it is very important to understand spring core. You can always go back and read it again once you use it a bit and get more context.

2

u/Falcao_E Dec 08 '20

Thank for you this sir!

2

u/dartalley Intermediate Brewer Dec 09 '20

If you want a job you need to learn Spring. Love it or hate it, you have to know it if you want a job.

I have been a professional Java developer for over 10 years and not one of the companies I worked for has used Spring (Amazon and several start-ups). I wouldn't disagree that it is the most popular framework out there and it's a good idea to know but plenty of places don't use it.

There are many lightweight web servers or smaller frameworks that tend to be popular in start-ups and smaller companies.

2

u/wildjokers Dec 09 '20 edited Dec 09 '20

I also went the first 15 yrs of my java career without touching Spring. I needed to switch jobs a few years back because of things going downhill due to an acquisition and me not having Spring experience was somewhat of an issue.

I had mostly used Jersey and many versions of JavaEE including the ones (6-8) that became annotation based, so Spring wasn't too much of a stretch. After I accepted an offer at a place that used Spring I read the docs for Spring Core, MVC, and Spring Boot in my 2-week notice period and hit the ground running at my new job.

Spring has seemed to dumb down Java developers and I am constantly surprised how many java developers are lost without it.

Its ok, I don't hate it, but I wouldn't miss it if I was somewhere that didn't use it.

5

u/__helix__ Dec 08 '20

Early on, almost everything you might be doing is some sort of CRUD web app. If you can go end to end, you are ahead of your peers.

Spring, like others have said, likely as a basis for some sort of REST endpoint. Assuming you are a junior developer and list it, I'd ask:

  • create a rest endpoint that does a telephone number lookup in a database. You pick the database.

  • Would ask you to talk about an MVC pattern, and see if you had seen design patterns before. May ask about a singleton, and how Spring uses those.

  • How are you set up the endpoint? Controller config and setup for POST/GET/params etc.

  • How are you configuring your application properties to deal with different test/stage/prod settings.

  • How did you test it?

While it could be argued if it is a framework - JDBC, connecting to Elastic, Cassandra, or one of the other 'major' databases - should be within your skill set.

Lastly, learn docker. Makes it very easy to hand code/environments off and likely will be part of your day to day.

2

u/Falcao_E Dec 08 '20

Thanks for this. Needles to say after reading the comments that spring is a must

1

u/__helix__ Dec 08 '20

Just one of the more common options. Spring has more or less taken over what use to be the J2EE space of 'common' configuration, components, and application development. It has a very rich set of tools at this point. I've not touched them all.

Faster Jackson for parsing JSON/XML/YAML. Apache commons, and other smaller components are worth your time too.

Ideally you should know the basics on GIT, a bit of Maven or Gradle, a CI/CD pipeline like Jenkins, and a testing framework like JUnit/Spock/Cucumber. Keep in mind - expectation as a new grad is not very high - so if you can connect the dots on these or more, you are in very good shape.

Continued practice with the language is always a good thing. Get to know streams, lambdas, completable futures, and some of the more advanced Java concepts. Universities tend to focus on Java 6/7 style coding.

32

u/marvk Dec 08 '20

Spring

 

 

 

 

 

other things

4

u/[deleted] Dec 08 '20

Given how Spring usually applies to big code-bases, how do you suggest people learn it while working full time? Just make a big product that uses it?

13

u/marvk Dec 08 '20

Check out https://spring.io/guides, check out https://github.com/spring-projects/spring-petclinic, do not read Spring in Action, Fourth Edition as it's hot garbage with code that ranges from plainly not working to not even compiling.

3

u/8bagels Dec 08 '20

You can build big projects with it but some of the projects I’m most proud of are tiny but crazy useful. For example I have a binary or command I need run on my machine (some proprietary thing at work), I’d like to execute it in a more event driven way (message on a queue or http request). I have a tiny spring app that exposes a web endpoint, authenticates the inbound user, and then executed the binary with the data in the POST. I turn the results into json and reply with it. It’s small but spring helped with the security, json, externalities config, and the init script to allow Linux systems to run it as a service. I could of wrapped that all up myself but it was so fast and easy with spring. It has run flawlessly for years only stopping for me to deploy new versions (I like to keep my dependencies up to date)

You may not have a use case just like that but the point was it’s a small and useful app I made, not a huge enterprise app, but I learned a lot about spring in the process.

Like another commenter said look at Spring Guides and then start to mash them up. Follow the web service guide, follow the jms guide, then combine them to expose a web endpoint that when called queues up messages on a queue. Now swap out the jms for aws SQS. And just play with tech

What’s something you love? D&D? Make a small app that fills a character (4d6 drop lowest) and hook that up to a web endpoint or just run it as a command line runner. But return the character and some of the other stats figured out and randomly generate a character name and randomly generate an adventure hook. Hook that up to the Twitter api and once a day your followers are treated to a randomly generated character and adventure .

To learn take your interests and code against them

1

u/[deleted] Dec 08 '20

I have a tiny spring app that exposes a web endpoint, authenticates the inbound user, and then executed the binary with the data in the POST. ...

That sound pretty sweet!

3

u/wolfanyd Dec 08 '20

Spring Boot

2

u/JacobJMountain Extreme Brewer Dec 08 '20

I’d recommend learning spring first, it can be difficult to learn what spring boot does for you / the difference otherwise

1

u/desktoppc Dec 12 '20

any course recommendation? My background is Python Django. I shocked that in Java Spring you have to implement your own ORM and you have to configure the SQL query (I haven't done anything like this before in Python Django).

How do I start to learn? There is so many spring frameworks like Hibernate, Security, etc.

2

u/HecknChonker Extreme Brewer Dec 08 '20

It really isn't just for large products. I'd say the most common use case is for building microservices these days.

5

u/Fenxis Dec 08 '20 edited Dec 08 '20

On a lighter end of the scale the Google Guava and Apache Commons libraries can save you from coding a ton of error prone Util methods.

My first stop with a issue is to Google "java <problem>Util" (ExceptionUtil, StringUtil, ArrayUtil) and something will pop up. A bit less needed with newer Java versions adding default methods to Interfaces but still useful.

2

u/E3FxGaming Dec 08 '20

Ok, if Spring is on the high end of the scale and Google Guave + Apache Commons are on the lighter end, then my suggestion is probably somewhere in between:

An ORM (object-to-rationale-mapping) framework. Correctly set up, they can save a ton of time. While most of them can do a lot more, their basic functionality boils down to: you have a database + you have your Java program -> query data from the database and map the results to Java object instances, and when you make changes to those Java object instances it takes care of changing the data in the database.

Hibernate is the most popular ORM framework for Java, it is however said to be a bit difficult. IMHO you can start with any ORM framework, (for spare time projects I started with Apache Cayenne and switched to ktorm after getting used to Kotlin), just be aware of that Hibernate will help you the most of all the ORM frameworks in a work environment.

4

u/One_Vacation9289 Dec 08 '20

I'm a microservice developer and Spring Boot is my bff

0

u/zfolwick Dec 08 '20

isn't spring kind of heavy for a microservice?

1

u/wildjokers Dec 09 '20 edited Dec 09 '20

µservice doesn't mean the size of the deployment artifact is small. It means its problem domain is small.

If you don't care about startup times (and for most apps that isn't important) then it is perfectly fine for µservices. Its runtime dependency injection can result in relatively long startup times (multiple seconds), especially once you have JPA in your app.

Startup time is only a problem in those situations when µservices need to be fired up super-quickly in a "serverless" type scenario. But in those envs even VM startup time is too slow and that is where GraalVM and native images come into play.

1

u/zfolwick Dec 09 '20

I appreciate the reply, but the greek letter just tickles me. thanks for that too.

3

u/xplosm Dec 08 '20

I love Dropwizard for very lightweight microservices. It's more than a framework. Sure you can have a nice Spring-based ecosystem including microservices but if your infrastructure and needs don't justify Spring, I'd go with Dropwizard.

2

u/wsppan Dec 08 '20

Spring

2

u/Kango_V Dec 09 '20

Spring, because you have to. Although it has now become the new J2EE (if you remember that). I see Spring as the "nobody ever got shot for buying IBM" framework. For us we've ditched Spring and gone with Micronaut. Awesome stuff.

1

u/wildjokers Dec 09 '20

I see Spring as the "nobody ever got shot for buying IBM" framework.

Pretty much this.

1

u/squishles Dec 08 '20

spring, hibernate

those two and you're good for 90% of java shops

1

u/zfolwick Dec 08 '20

I can't seem to get rid of spring boot, no matter how hard I try. Maybe learn that and espresso.

Kotlin is really cool.