by mr_puzzled on 8/3/19, 7:56 PM with 13 comments
- 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/packages such as lombok work in eclipse but not in vs code! And even in eclipse there's some annotation (@Data I think) that's supposed to generate getters and setters but it doesn't work.
- 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!
- Magic : this is incredibly frustrating. Some repository types are automatically exported, some are not and the docs do an atrocious job of explaing what's going on. Place some file abc.xyz in the root and magic happens!
- 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?
- I hate to admit this, but I still don't know what a god damn bean is, what AOP is, what inversion of control is.
This was mainly a rant and a bad one at that, but I had to vent.
by karmakaze on 8/4/19, 4:07 AM
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.
by tmm84 on 8/7/19, 4:22 AM
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.
by jryan49 on 8/4/19, 3:56 AM
by maynman on 8/6/19, 3:39 PM
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/
It makes the initial setup easier.
by mr_puzzled on 8/3/19, 7:56 PM
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.
by codegladiator on 8/3/19, 8:40 PM
spring definitely feels like magic for first 6 months.
aop and ioc exist outside of spring and java as well.
by AwesomeFaic on 8/6/19, 6:27 PM
by yasp on 8/3/19, 8:04 PM
by BjoernKW on 8/4/19, 1:24 PM
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/ and 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 ) 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) delegate wiring to Spring dependency injection.