r/javahelp • • Jul 08 '21

Node dev wants to understand spring

I've been building APIs for a while now and I would consider myself pretty component in Node.js and Express. As a result I know a lot about the Node.js ecosystem (tools, packages, yada yada). I want to transition into Spring Boot and carry over as much of my Node.js knowledge as possible. I've done some research, but the whole Java world is very foreign to me. Can anyone recommend resources that explain Spring concepts while giving examples in Node.js. Asking for a friend.

17 Upvotes

12 comments sorted by

View all comments

Show parent comments

11

u/wsppan Jul 08 '21

Enough to be fluent in OO programming. Spring is a Java framework. You write Java code when using Spring. Java is an OO language.

0

u/[deleted] Jul 08 '21

[deleted]

3

u/[deleted] Jul 08 '21 edited Jul 08 '21

AOP, at least the way that it is done in normal Spring (and not crazy AspectJ), is a standard OOP implementation pattern, particularly the Decorator Pattern.

Spring itself is an IoC container, particularly implementing the "O" and "D" of the SOLID OOP programming principles, Open/Closed Principle and Dependency Inversion Principle. If you understand OCP and DIP, you will have a much better grasp of how Spring components actually work and how to customize their behavior.

For example, RestTemplate can use any HTTP client in existence, all because of DIP and OCP. Understand that, and you'll truly understand Spring.

1

u/lookForProject Jul 08 '21 edited Jul 08 '21

Fair enough, I was incorrect. But as an aside, I do not try to make the claim that to understand Java en Spring, you don't need to understand OO. But I did not understand the strong singular focus on OO.

Until I reread the thread and noticed that OP had difficulty with OO. So the focus makes sense.