r/learnjava • • Dec 12 '20

[ASK] How to Learn Java Spring?

I have a background in backend development using Python Django, but now I have to use Java Spring. I can do programming in Java but haven't used Spring.

But the problem is there are so many Java Spring framework like Hibernate, Security, MVC, etc. In addition, I also see that we have to define our ORM implementation like how to make the SQL query, etc. I haven't done anything like that because in Python Django the ORM implementation has been made by the framework.

I would like to learn how to make a REST API as most of the backend job required this for Junior Engineer (Fresh Graduate), how do I start? do I need to learn all java spring framework?

78 Upvotes

46 comments sorted by

View all comments

5

u/[deleted] Dec 12 '20

You don’t need to know too much spring to make a basic rest api. If you know how to connect and communicate (CRUD) with a database that’s a big part. If you want a microservice design check out eureka with spring cloud to communicate among your services. If you understand the basics of spring (auto-injection, some basic annotations, @component @configuration, @entity ) making a rest api shouldn’t be too hard. Check out java brains, he has a ton of good stuff on spring and rest api

3

u/desktoppc Dec 12 '20

okay I checked the Java Brains and found this: https://www.javabrains.io/courses/springboot-quickstart

is that a recommended course? but the video was made in 2016.

I also found this tutorial from freecodecamp: https://www.youtube.com/watch?v=vtPkZShrvXQ but in 1:41:14 I saw that the author have to implement how the model will be mapped into the SQL database. Need to define the SQL query. It is an uncommon thing for me because in Django I don't have to do that, I just have to declare the model and the attributes and Django will implement it automatically.

1

u/grafcetonline Dec 12 '20

If you wanna get a java dev job you MUST know SQL even if you use ORM because it is considered ground knowledge ;)

For example once I was PM on a Java project the Hibernate performance was awfull I asked devs to look at SQL below so they did so and omptimized to a decent performance.

1

u/carrdinal-dnb Dec 13 '20

Depending on what you are doing you may not need to write much or any SQL, spring data JPA repositories allow you to define query methods which can be useful for simple queries, though there are lots of other options for varying levels of abstraction/control. Also you aren’t limited to SQL, document databases are a natural fit for storing aggregates in a micro-service architecture and I’d recommend you take a look into those and see if they fit in with your project!