My experience using Spring boot for website development

  • 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.

  • 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.

  • 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.

  • 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/

    It makes the initial setup easier.

  • 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.

  • 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.

  • 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.

  • 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.

  • #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/ 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.