Monday, April 8, 2019
On April 08, 2019 by Kamlesh 1 comment
What does spring framework do?
Spring framework lets you develop java j2ee applications in a rapid easy way,Simple right.
But the problem is setting up spring project manually as it involved lot of configurations.
What does spring boot do?
Spring boot aims to wrap all the spring components in a convenient way with no external xml configuration whatsoever. so basically spring boot lets you create a microservice that wraps the spring core in an easy way.
If you create a spring boot project using spring intializr or in any other way, you will see below maven dependency in pom.xml file which downloads all the spring core components that is required to develop an application,you don't need to add manually each component in the project as you do in manual set up of spring framework.
Components like springs core, hibernate validators, logging etc will be downloaded.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
Since above dependency is a parent, all the other dependencies will be treated as child, No need to mention the version of any child dependencies you are going to add, compatible child dependencies are added based on the parent version.
This is a huge advantage of spring boot over manual set up of springs framework, Just imagine manually adding all the dependencies that needs to be compatible to all other existing dependencies, we have all suffered that pain.
Typical spring boot pom would look as shown below
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spring.security.demo</groupId>
<artifactId>SpringSecurity</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringSecurity</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- To compile JSP files -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
In addition to that, Spring boot provides Spring Boot Data JPA which helps in quering with database in a much easy and quick way, See how it is here
Feature Spring Framework Spring Boot
Configuration XML(lot of pain) Annotations(No pain buddy)
Server Need External Server Comes with Embedded Server
ORM Hibernate Spring Boot Data JPA
Actuator Supported Works well with spring boot
Controller Only Web Web and Rest
Do not consider above table as comparison, try to consider as advantages of spring boot over spring framework.
Conclusion
Spring framework was introduced to make it easy for developers to develop an application in short period of time using spring components that will help in focusing more on business logic rather than DAO layer or Controller.
But it involved many problems like manual setup that involved a lot of configuration,persisting mechanism was not very quick and needed some kind of knowledge on hibernate etc.
And Spring boot was introduced to make it much more easy for developers by removing manual setup,removing configuration and introducing spring boot jpa for persisting mechanism.
Note: Spring Boot acts as a container for spring components(spring framework) with very minimal configuration and with lots of other advantages.
Spring framework lets you develop java j2ee applications in a rapid easy way,Simple right.
But the problem is setting up spring project manually as it involved lot of configurations.
What does spring boot do?
Spring boot aims to wrap all the spring components in a convenient way with no external xml configuration whatsoever. so basically spring boot lets you create a microservice that wraps the spring core in an easy way.
If you create a spring boot project using spring intializr or in any other way, you will see below maven dependency in pom.xml file which downloads all the spring core components that is required to develop an application,you don't need to add manually each component in the project as you do in manual set up of spring framework.
Components like springs core, hibernate validators, logging etc will be downloaded.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
Since above dependency is a parent, all the other dependencies will be treated as child, No need to mention the version of any child dependencies you are going to add, compatible child dependencies are added based on the parent version.
This is a huge advantage of spring boot over manual set up of springs framework, Just imagine manually adding all the dependencies that needs to be compatible to all other existing dependencies, we have all suffered that pain.
Typical spring boot pom would look as shown below
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spring.security.demo</groupId>
<artifactId>SpringSecurity</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringSecurity</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- To compile JSP files -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
In addition to that, Spring boot provides Spring Boot Data JPA which helps in quering with database in a much easy and quick way, See how it is here
Feature Spring Framework Spring Boot
Configuration XML(lot of pain) Annotations(No pain buddy)
Server Need External Server Comes with Embedded Server
ORM Hibernate Spring Boot Data JPA
Actuator Supported Works well with spring boot
Controller Only Web Web and Rest
Do not consider above table as comparison, try to consider as advantages of spring boot over spring framework.
Conclusion
Spring framework was introduced to make it easy for developers to develop an application in short period of time using spring components that will help in focusing more on business logic rather than DAO layer or Controller.
But it involved many problems like manual setup that involved a lot of configuration,persisting mechanism was not very quick and needed some kind of knowledge on hibernate etc.
And Spring boot was introduced to make it much more easy for developers by removing manual setup,removing configuration and introducing spring boot jpa for persisting mechanism.
Note: Spring Boot acts as a container for spring components(spring framework) with very minimal configuration and with lots of other advantages.
Subscribe to:
Post Comments (Atom)
Search
AdSense
Recent Posts
Popular Posts
-
WLST Script for checking the health status of Weblogic Domain (Admin/Managed node) After long time writing something about WLST WLST...
-
WLST Script for checking the status of JDBC Datasource in Weblogic WLST has some good features like we can monitor the weblogic dom...
-
WLST Script for Monitoring the JMS status of Weblogic Domain After long time writing something about WLST WLST has some good feature...
-
WLST Server Start The server of a WebLogic domain can be started using different techniques. The best setup depends on the technical re...
-
How to Deploy Application using WLST We can use WLST to quickly deploy an Application in a Weblogic Server. Requirement:- · The ...
-
How to create WebLogic Domain using Domain template: 1. Open an existing domain template (assuming WebLogic Server is installed at c:...
-
Basic concepts of WLST. What is WLST? It is a scripting tool offered by Weblogic. Any way WLST is not only for a sense of control,...
-
Hi All, writing something about OPMN utility with oracle instance and Weblogic. WebLogic Server – Weblogic is J2EE application ...
-
Hadoop Distributed Filesystem (HDFS) Built to support high throughput, streaming reads and writes of extremely large files. NAS ...
-
Before diving into this implementation, I would suggest you to look at Spring Security Introduction first. Let's Start Most of the We...
Recent Posts
Sample Text
Blog Archive
-
▼
2019
(13)
-
▼
April
(13)
- Spring MVC vs Spring Boot
- Spring Security With Spring Boot Example
- What is Spring Security?
- Adding your own implementation in JPA
- Crud Operations using Spring Data JPA
- What is Spring Boot JPA?
- YAML and Application.Properties Configuration in S...
- How Controller works in Spring Boot?
- What is Annotation?
- Setting up Spring Boot
- Why Spring Boot?
- What is Spring Boot?
- Spring Boot Tutorials
-
▼
April
(13)
Total Pageviews
Find Us On Facebook
Powered by Blogger.
If you're attempting to burn fat then you certainly have to get on this totally brand new custom keto plan.
ReplyDeleteTo create this keto diet service, certified nutritionists, fitness trainers, and top chefs have united to develop keto meal plans that are powerful, painless, cost-efficient, and delightful.
From their first launch in early 2019, 1000's of people have already completely transformed their figure and well-being with the benefits a good keto plan can give.
Speaking of benefits: clicking this link, you'll discover 8 scientifically-proven ones offered by the keto plan.