r/javahelp • • Apr 16 '19

Shoutout to Spring developers

You guys who understand and use Spring are gods.

This is the most advanced thing I’ve ever seen, all I get are problems and I haven’t a clue how any of it works and honestly at this point I want to go back to single class console based applications.

And I thought Swing was tricky at first.... HA!

18 Upvotes

15 comments sorted by

3

u/GrapeAte Apr 16 '19

Is there a specific issue you want help with? Parts of Spring can seem very complicated at first, but if you can grok the concepts things become easier to understand.

4

u/[deleted] Apr 16 '19

Not at the moment, this is genuinely an appreciation post for you guys, kind of posted in frustration haha.

I think my biggest struggle at the moment is translating all this stuff I'm learning into an actual project I can put on my resume. I can follow along some videos and understand why we're doing stuff, but if you told me to just make a Spring app from scratch right now... LOL.

1

u/wishicouldcode Intermediate Brewer Apr 17 '19

Usually you would start with the bare minimum (spring boot, spring-data-xxx , spring-starter-web) and add anything later to the pom or gradle when you need it. (Eg. spring-security). Just Google 'library name> maven' to get the entry. There is a spring cli (and IDE plugins) to generate projects from command line, but the spring starter site mentioned is what I use.

1

u/joshuaherman Apr 17 '19

Yeah. Spring security...

2

u/vbsteven Apr 17 '19

It can be a bit overwhelming in the beginning. Start small with a simple hello world web app on Spring Boot and move up from there. Experiment a lot when trying new things and don’t be afraid to jump into the source for some of the annotations.

Once you grasp the way the dependency injection and Spring Boot autoconfigurations etc work it becomes a joy to work with.

Once it “clicks” it’s amazing. I use Spring Boot for almost every project I started in the last few years. I’m very productive because of it and it allows me to focus on my actual code instead of configuring how everything ties together. A couple well placed annotations usually do the trick and most of them are second nature to me now.

Reading a book like Cloud Native Java or Spring in Action and Spring Boot in Action can help for understanding how the framework is supposed to be used.

1

u/Cucumberino Apr 16 '19

So, might be a dumb question, but for said Spring devs, when should I get started with Spring? Asap or is it more focused for web apps? I've started developing my own program using Maven (and also JavaFX but doubt that matters here), and I remember reading I can use Maven + Spring, I just haven't had time to do the research as of now and don't know if I should just try to implement it into any project like I seem to be doing with Maven currently.

2

u/LostInDarkMatter Apr 17 '19

Search for spring boot tutorial. You'll have a hello world web app in just a few minutes. From there, study the annotations so you can see how dependency injection works. And take the time to read the excellent docs.

See also 12 factor app so that you're thinking cloud from the start.

0

u/[deleted] Apr 17 '19

[deleted]

1

u/Cucumberino Apr 17 '19

Thank you!

0

u/[deleted] Apr 16 '19

[deleted]

6

u/[deleted] Apr 16 '19

I hate that stuff, I'm trying to show employers how I can understand and use the language, rather than do some abstract algorithm in the console etc. I'm very curious to see how Spring is used in a professional environment, as every single job listing in London requires Java EE and Spring knowledge.

2

u/denialerror Apr 17 '19

If this is for your first job, I would just focus on being enthusiastic and show a willingness to learn. Any company worth its salt would expect to teach a junior developer as if they were a blank slate. If they want you to be proficient at Spring without any professional experience, it's because they don't want to pay the rates.

If this isn't your first job and you are an experienced developer, Spring shouldn't be a problem. It is a Dependency Injection framework with some nice web and data access functionality.

1

u/bostown03 Apr 17 '19

I've seen spring bastardized in ways i didn't know could be done. Manual context initialization sprinkled with some reflection because some beans didnt get initialized by the container etc etc... I've seen some things......

0

u/[deleted] Apr 16 '19

[deleted]

2

u/[deleted] Apr 16 '19

After a little more thought, I think the thing I'm struggling the most with is the idea of choosing which dependencies to use. Like, is it a case of you just use a few a lot ? Or am I supposed to be able to have an idea for what I need, download that specific dependency then use all the things that dependency makes available to me in my program. That's whats blowing my mind.

3

u/slowfly1st Apr 16 '19

Or am I supposed to be able to have an idea for what I need

Yes.

https://start.spring.io/?

Just use a gradle or maven. If you need another dependency, it's a few lines in your build.gradle/pom.xml, and the IDE will download it and setup the project automatically.

2

u/[deleted] Apr 16 '19

That webpage is a fantastic resource, thank you.

I use gradle and maven, I just find it overwhelming trying to think of what dependencies I could use, theres thousands

0

u/[deleted] Apr 17 '19

[deleted]

2

u/[deleted] Apr 17 '19

Oh really! That gives me a lot of hope lol, this thread has given me a great sense of what kind of dependencies we use now.

At first I thought it was like, a gaming add-on type deal, where’s there’s thousands to choose from and you can’t really see them all etc.

But now I see it’s more about choosing the minimum of what you need, maybe following MVC architecture or something. I’ll take some time today to really study some of the core dependencies like Spring-boot and spring-web etc, and see how they work.