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.

2

u/WikiSummarizerBot Jul 08 '21

Decorator_pattern

In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class. The decorator pattern is often useful for adhering to the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concern. Decorator use can be more efficient than subclassing, because an object's behavior can be augmented without defining an entirely new object.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5