
My experience using Spring boot for website development - mr_puzzled
At work, I was asked to learn spring boot and the first task was to build a simple crud app, just end to end functionality for a model with automated tests, builds, static code analysis etc. I hate to admit it, but for the first few days (and even now) I couldn&#x27;t tell which was up and which way was down, nothing made sense.<p>- Installation was a nightmare. Workplace uses windows, so the usual dance of installing the jdk, setting the env variables, creating a project in eclipse and for some reason it uses the jre instead of the jdk. Some plugins&#x2F;packages such as lombok work in eclipse but not in vs code! And even in eclipse there&#x27;s some annotation (@Data I think) that&#x27;s supposed to generate getters and setters but it doesn&#x27;t work.<p>- Flexible architecture : some use service, serviceimpl and controllers. Some skip the service interface. And it turns out you can extend crudrepository and have a fully functioning rest endpoint without writing any code using spring data rest!<p>- Magic : this is incredibly frustrating. Some repository types are automatically exported, some are not and the docs do an atrocious job of explaing what&#x27;s going on. Place some file abc.xyz in the root and magic happens!<p>- Docs : the single worst part of learning spring boot, especially for newcomers. How can the docs possibly be so insensitive to newcomers? Or do they expect only experienced devs at big cos to use spring boot?<p>- I hate to admit this, but I still don&#x27;t know what a god damn bean is, what AOP is, what inversion of control is.<p>This was mainly a rant and a bad one at that, but I had to vent.
======
karmakaze
I would say that you were likely more successful than the typical first time
exposure using Sprint Boot.

Your comments also sound spot-on to much of my first time exposure to Spring
(pre Boot). I've used Spring and Spring Boot on many projects since and it
wouldn't be my first choice. It tends to be selected for its popularity which
means there are StackOverflow answers, pretty good support for common use
cases, and a large pool to hire from.

At the same time, Spring Boot (or even just Spring) aren't the worst once you
get used to them. I myself have come to dislike other aspects of it (e.g. slow
startup, JPQL and Hibernate quirks, excessive gc, poor scaling). Most of these
things probably won't have much of an impact until the application gets to a
certain level of complexity or scale. But if it wasn't about solving for the
future, Ruby or Python would be better to start.

------
tmm84
I've been programming in Java since I started working as a programmer.
Learning to setup a Windows machine for Java development is difficult if you
aren't familiar with environment variables and the like.

Java, like C++, has gotten more and more features/keywords over the years.
Frameworks like Spring Boot tend to make use of those features. Also, Spring
Boot is a sit down and read the guides compared to something like Rails or
ExpressJS and the like. Depending on your Java knowledge the documentation is
going to be hit or miss I think. Also, convention over configuration makes it
harder for new developers to get the hang of developing with a framework like
Spring Boot because they don't know the conventions usually.

------
jryan49
It really doesn't take that long to read the Spring docs. I know a few days
for some devs is an eternity though. The magic can be frustrating though and
burn you. When you have millions of lines of code in a project though, AOP and
Spring can make your life bearable. I'd much rather spend the time to learn
some magic than have to deal with that much boilerplate. Spring is most likely
overkill for a small/medium sized project.

------
maynman
One suggestion I have is to try using Intellij as your IDE. It has some built
in integrations that make spinning up a new spring boot project a lot simpler.

Or, if you really like using an IDE that doesn't offer these integrations,
then another option is to make use of this page:
[https://start.spring.io/](https://start.spring.io/)

It makes the initial setup easier.

------
mr_puzzled
Continuation:

I will likely be changing teams soon, so hopefully this will be the last time
I use spring boot.

Now I am not a complete noob to webdev. I have worked with django extensively
and I have had a pleasant expereince with it. Everything is so beuatifully
thought out, the docs are wonderful and I am never left scratching my head
wanting to curse at the top of my lungs.

I'd love to hear your thoughts on this topic.

~~~
jryan49
What docs were you reading? I've found Spring docs to be incredibly detailed
and comprehensive. You do have to read it like a book though, and it will take
days. It really is like it's own programming language.

This is what I've read [0]

0: [https://docs.spring.io/spring/docs/5.2.0.BUILD-
SNAPSHOT/spri...](https://docs.spring.io/spring/docs/5.2.0.BUILD-
SNAPSHOT/spring-framework-reference/)

[https://docs.spring.io/spring/docs/current/spring-
framework-...](https://docs.spring.io/spring/docs/current/spring-framework-
reference/web.html)

[https://docs.spring.io/spring-
data/jpa/docs/current/referenc...](https://docs.spring.io/spring-
data/jpa/docs/current/reference/html/#repositories.definition)

I thought installing JDK was pretty okay on windows with
[https://adoptopenjdk.net/installation.html#windows-
msi](https://adoptopenjdk.net/installation.html#windows-msi) It does all the
PATH and ENV settings for you.

------
codegladiator
either you go in with a mentor to understand spring or read their docs like a
book for a day or two. otherwise everything will feel like your point 3, magic

spring definitely feels like magic for first 6 months.

aop and ioc exist outside of spring and java as well.

------
AwesomeFaic
I use Intellij with Spring and all that jazz at work. Massive enterprise
software. I don't _hate_ it, but boy, I can see why these behemoth
applications move at a snail's pace.

------
yasp
You mention Django. What amount of experience with Java did you have going
into this? IMO Java development has a steeper learning curve than Python
development.

~~~
mr_puzzled
I used java for competitive coding competions, so I know the basics, but I've
never used any frameworks in java before. Having experience in web development
and knowing the basics of java, I thought I would be productive in spring boot
in a few weeks but I never would have guessed I would be so completely lost
with spring boot. (please don't ask me how many weeks I spent learning spring
boot, it's simply embarrassing).

(I'll be offline for a few hours, I'll check back here in a few)

~~~
Sevii
Using Java in coding competitions is an entirely different world from
production enterprise java development. It may as well be a different
language. Trying to learn all the Java patterns, annotations, web servers, etc
for one CRUD app is a lot to tackle.

------
BjoernKW
#1 is a mostly Windows-related problem. You would've had similar issues with a
Ruby- or JavaScript-based stack, probably much more so because Java generally
is quite decent in terms of platform-independence. With other environments you
often have to deal with native binaries or compiling for your specific
architecture, which can get messy if things don't work as expected during
installation.

I agree that the magic behind autowiring different types of Spring Data
repositories can be quite confusing.

The Spring Boot documentation in general is quite good, though. There are many
how-tos and specific examples with working source code. Apart from Pivotal's
(the company that's the main maintainer of Spring and Spring Boot) own
resources, [https://www.baeldung.com/](https://www.baeldung.com/) and
[https://www.mkyong.com/](https://www.mkyong.com/) are fantastic for learning
about Spring and Spring Boot, too.

Concepts such as AOP or inversion of control aren't exclusive to Spring Boot
(or Java, for that matter). It's useful to learn about them anyway and yes, if
you don't know about those subjects before starting with Spring Boot you're in
for quite a steep learning curve because you'll not only have to grasp the ins
and outs and implementation details of a new framework but understand entirely
new abstract concepts at the same time as well.

As for beans specifically, the definition of that term within the larger
context of Java has varied a bit over time so there might be at least some
ambiguity here, which can lead to understandable confusion. Traditionally, a
bean in Java is a class which a.) is serialisable, b.) has a zero-argument
constructor and c.) has getters and setters for modifying the internal state
of its instances. Due to these properties beans lend themselves to storing and
passing application state (for example in the larger context of a dependency
injection environment).

With Spring and Spring Boot, 'bean' usually refers to the @Bean annotation
that allows to have a method return an instance of a particular class, which
will then be made available to other components of the application through
Spring's dependency injection.

The @Bean annotation leaves the object instantiation and wiring to the user
(see [https://www.baeldung.com/spring-bean](https://www.baeldung.com/spring-
bean) ) whereas other Spring annotations such as @Component or @Service (both
are so-called stereotypes, with @Component being the more generic one that
simply marks a class as 'managed by Spring' while @Service denotes that the
component in question is to be used within the application's service layer.
See [https://www.baeldung.com/spring-component-repository-
service](https://www.baeldung.com/spring-component-repository-service))
delegate wiring to Spring dependency injection.

