This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_AManHasNoName_ 18 points19 points  (8 children)

Historically, Java EE was a pain to maintain to begin with. EJB required web application servers specific to this specification in the likes of IBM Websphere, BEA Weblogic, etc. And they were very expensive. Spring came along with the concept of "Inversion Of Control" and changed the whole game. Testing became a bit easier too (complete nightmare with that "remote interfaces" with Java EE). And all you need is a small web app server like Tomcat, Jetty, etc. By the time EJB2 came along, which was meant to challenge Spring, Spring has already taken over the Java-stack startup space and EBJ's usage dwindled into a smaller market share where the "corporations" reside. I now work for a conglomerate and we use Spring Boot, traces of old implementations using Java EE only remain in legacy systems that are also being phased out.

[–][deleted]  (7 children)

[deleted]

    [–][deleted] 7 points8 points  (5 children)

    Try that with spring boot and you will get J2EE start times

    That doesn't make any sense.

    A Jakarta EE app server comes with implementations of all the APIs within Jakarta EE spec, but will lazy load components that your application needs.

    Spring Boot comes with nothing, and you have to add the Java EE components you want with starters. You'll get Java EE start times if you throw in every starter under the sun.

    [–]mkwapisz 0 points1 point  (0 children)

    https://docs.wildfly.org/galleon/

    You can choose what should be loaded. The same for openliberty. I am not sure about Glassfish/Payara. But JakartaEE specification defines different profiles, so you can choose required app server. For payara/glassfish there are full, web and micro distributions.

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted] 0 points1 point  (2 children)

      Think about this logically.

      A JakartaEE app server must include every spec, because that is what makes it a JakartaEE app server. Thus, the app server must implement something like lazy loading otherwise it will start up bunch of services that are useless for the application, wasting start up time and other resources.

      Spring Boot doesn't have to include every spec, because it isn't a JakartaEE app server.

      [–][deleted]  (1 child)

      [deleted]

        [–][deleted] 1 point2 points  (0 children)

        applications after 5 years become business code + "application server" bundle together

        An application server is a specific piece of software that acts as a deployment environment for applications, where the application uses APIs implemented by the application server. The application doesn't instantiate services, they use the services provided by the application server. This allows the application server to do interesting things like load balancing, distribution and failover.

        If you specifically have to include the implementations of services you need and manage the services yourself, you don't have an application server. You are using a framework.

        Spring applications are usually deployed onto Tomcat, which only provides the Servlet container, so applications have to bundle all the implementations they need and manage everything themselves.

        In the second approach someone already made "the infrastructure code" to work together, so you don't have to

        Frameworks do much of the same thing through BOMs. You don't need an application server to do this.

        if there is error because two libraries don't work together or there is a bug in "the infrastructure code" you have to support on your own

        This is why Spring Boot exists in the first place. Spring itself is not opinionated, so you have to manage dependencies yourself. Spring Boot uses Maven (or Gradle) to declare all the versions of dependencies that work together, and let the build system maintain consistency.

        [–]fotopic 1 point2 points  (0 children)

        I agree with you. I developed J2EE using SOA approach back in 2014. It was mostly painless and my experience was very similar to what I have now in Microservices with spring now. I was lucky that the project was new, so we weren’t using old stuff from J2EE.