Wednesday, July 18, 2018

Difference Between Spring Boot and Spring Framework

In this post you will learn some important differences between Spring Framework and Spring Boot. Spring framework is a Injection dependency framework at first (it's still as it is today) targeting managing life-cycle of Java components (what so-called beans). Today, Spring framework is pretty bloated with tons facilities/helpers on top of it; but if you look at the big picture, it's still a framework that glue things together, a middle man to MVC frameworks (Struts 1,2, JSF etc), ORM frameworks (Hibernate, iBatis, JOOQ etc) and other necessary facilities (Quartz, Email, you can tell, whatever you need, most likely, there's a Spring support). Back to our assumed flow, it takes quite a lengthy tutorial to set Spring framework up and running because Spring framework nature is to provide flexibility of choices to you.

Spring framework is said to be a non-invasive means it doesn’t force a programmer to extend or implement their class from any predefined class or interface given by Spring API, in struts we used to extend Action Class right that’s why struts is said to be invasive
In case of struts framework, it will forces the programmer that, the programmer class must extend from the base class provided by struts API
Spring is light weight framework because of its POJO model
Spring Framework made J2EE application development little easier, by introducing POJO model
Spring having this much of demand because of the following 3 reasons….
  1. Simplicity
  2. Testability
  3. Loose Coupling

However using the Spring framework has some downsides:

  • Setting it up requires configuration.
  • Integrating with a library requires … configuration.
  • Running a web application requires a web server like Tomcat or a JEE server like JBoss and … configuration
  • You need to setup your own logging or at least configure it
  • The wealth of configuration options means no two applications are typically the same.
  • So the Spring Framework typically assumes nothing about its environment and integrates with almost every technology at the cost of configuration
spring boot:

first of all Spring Boot is not a framework, it is a way to ease to create stand-alone application with minimal or zero configurations. It is approach to develop spring based application with very less configuration. It provides defaults for code and annotation configuration to quick start new spring projects within no time. Spring Boot leverages existing spring projects as well as Third party projects to develop production ready applications. It provides a set of Starter Pom’s or gradle build files which one can use to add required dependencies and also facilitate auto configuration.

Spring Boot automatically configures required classes depending on the libraries on its classpath. Suppose your application want to interact with DB, if there are Spring Data libraries on class path then it automatically sets up connection to DB along with the Data Source class.



  • It is very easy to develop Spring Based applications with Java or Groovy.
  • Spring Boot reduces lots of development time and increases productivity.
  • It avoids writing lots of boilerplate Code, Annotations and XML Configuration.
  • It is very easy to integrate Spring Boot Application with its Spring Ecosystem like Spring JDBC, Spring ORM, Spring Data, Spring Security etc.
  • Spring Boot follows “Opinionated Defaults Configuration” Approach to reduce Developer effort
  • It provides Embedded HTTP servers like Tomcat, Jetty etc. to develop and test our web applications very easily.
  • It provides CLI (Command Line Interface) tool to develop and test Spring Boot (Java or Groovy) Applications from command prompt very easily and quickly.
  • Spring Boot provides lots of plugins to develop and test Spring Boot Applications very easily using Build Tools like Maven and Gradle
  • It provides lots of plugins to work with embedded and in-memory Databases very easily.
There are many advantages of using Spring Boot. Most of them are already posted by other answers to this question. It is my opinion that Spring Boot is one of the best things that happened in the Java community in years. It makes development faster, more focused and easier to learn. That’s something we’ve needed for a long time.




No comments:

Post a Comment

High Paying Jobs after Learning Python

Everyone knows Python is one of the most demand Programming Language. It is a computer programming language to build web applications and sc...