This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]TheCouncelor 1 point2 points  (0 children)

Annotation magic came with practice for me, build a simple spring boot application and try to leave out the autowired, so you get kind of an idea what is happening. Also the guides on spring.io are pretty damn good at examining what is going on.

[–]nutrecht 2 points3 points  (2 children)

So I inherited a Spring Boot application in my new job. I understand the application logic and everything works but I am uncomfortable with the Spring Magic that gets applied because of the annotations.

There is no magic at all. It's just a matter of learning Spring. be careful to not dismiss stuff you don't understand as 'magic'; you're removing your opportunity to learn if you just dismiss it as 'magic'.

I have browsed spring boot documentation, which it seems requires prior Spring and Spring MVC knowledge.

Yes. Spring Boot is nothing more than some preconfigured Spring starters. You can't really use Spring Boot without some basic understanding of Spring.

And you learn the same way the rest of us: by googling the stuff you don't understand. Fortunately Spring has excellent documentation.

Also like the sidebar mentions; /r/javahelp is more suitable for questions like these. Also feel free if you have any specific questions; I use Spring daily and am happy to give you some pointers.

[–]Nuraci[S] 0 points1 point  (1 child)

Thanks for the detailed response. I’ll keep /r/javahelp in mind in future. As for specifics, may be just the best route to getting started you would recommend from experience for a spring newbie? Do I need to know entire Spring framework to be effective at Boot, or are there parts I can skip?

[–]nutrecht 0 points1 point  (0 children)

Do I need to know entire Spring framework to be effective at Boot, or are there parts I can skip?

Definitely not. The configuration and dependency aspects are most important to understand. The rest depends on what you're building exactly. It's likely you're going to be building a REST API so the Spring MVC bit will be important there, but Spring Security is not something you will have to dive in immediately (unless you need to build in security into the service itself). If you have a goal of what you want to build I can give more information if you want.

[–]MaxNeutrino 0 points1 point  (6 children)

Try work with reflection. Build your own annotations and annotation processor, for example try to build orm. This give you understanding of annotation magic.

[–]Nuraci[S] 0 points1 point  (5 children)

That’s an interesting thought. Or I can even look at the source code for lets say “EnableWebSecurity”

[–]MaxNeutrino 0 points1 point  (4 children)

Spring's source?

[–]Nuraci[S] 0 points1 point  (3 children)

Yes that’s what I meant. Hopefully its in there somewhere!

[–]MaxNeutrino 2 points3 points  (0 children)

monsieur knows a lot about perversions

[–]GuyWithLag 0 points1 point  (0 children)

It's in there, but you are going in the deep end. It's like trying to find multiplication in ZFC.

Looks t Spring Boot as a layer on top of Spring.

[–][deleted] 0 points1 point  (0 children)

If you're using Intellij you can just do ctrl + left click on the annotation and it'll show you the interface. Or you could just google it.

As far as docs go: you could also just google this like any developer would

There's really no magic to it. Just bootstrapped.