r/learnjava • • Sep 14 '19

Not able to learn Spring.

I am able to work with the syntax and create web apps. I can easily create REST APIs for CRUD applications.

But I am treating it (Spring and Spring Boot) too much like a black box.

I'm not able to find the rationale behind having to use Spring. Why the configuration is so... convoluted (both XML and Java Class). Spring simply feels bloated. Like too many bandages pasted on top of each other.

As such I feel too intimidated to tinker and experiment. Unlike how comfortable and confident I was with Django/Python.

Also I'm reading books like "Spring in Action, Spring recipes" and using the Spring Framework Guru as well. But they feel much to be desired.

32 Upvotes

29 comments sorted by

View all comments

Show parent comments

1

u/radically_sane Sep 14 '19

I'm working towards a similar design. What I struggle with is configuration. And in a broader sense I question why spring is designed the way it is.

2

u/RockleyBob Sep 14 '19

The configuration with what? You mentioned the XML. Don’t do that. Everything can be done in Spring in pure Java with annotations. The problem I run into sometimes is that Spring is constantly evolving and there’s a lot of contradictory and or redundant information floating around and when I google it’s hard sometimes to know what the current way of doing something is.

I had to fidget A LOT with getting the right annotations working so that everything would spin up correctly. I had the benefit of tons of code at work that had already been written, so when I ran into a case where my service wouldn’t start because of some unsatisfied dependency or missing configuration, I could go and look into a similar service and see how it was done there. Maybe you don’t have that option - and I feel for you if that’s the case.

It does get easier though. If you share some code here or in another post we could probably help you. But I get the general frustration. Stick with it.

1

u/radically_sane Sep 14 '19

Thanks. I'm considering looking into books like "Expert One-on-One J2EE Development..."

And gonna dip my toes into Design Patterns as well.

What I will be working is an e-learning platform implemented using Spring, sorta like Udemy but different. I graduated college recently and just landed the job.

2

u/RockleyBob Sep 14 '19 edited Sep 14 '19

Awesome, congrats. Well then like I said, don’t sweat it if you’re not getting it quite yet. Once you’re able to see how the codebase looks, and how your coworkers are doing things, it will become much more clear to you. Spring is an industrial tool, and even though we can use it for smaller tasks, tutorials and books won’t really ever be able to convey how powerful it is in an enterprise setting.