SlideShare a Scribd company logo
Spring Boot
© copyright : spiraltrain@gmail.com
Course Schedule
2
• What is Spring Boot?
• Advantages Spring Boot
• Goal of Spring Boot
• Spring Boot Flavors
• Key Spring Boot Components
• Spring Boot Starter
• Starter Dependencies
• Spring Boot Autoconfigurator
• @SpringBootApplication
• Spring Boot CLI
• Spring Boot Internals
• Spring Boot Actuator
• Reflection
• Annotations
• Spring Core
• Aspect Orientation
• Groovy
• Spring Boot
www.spiraltrain.nl
What is Spring Boot?
• Spring Boot is completely new project from Spring Team :
• Framework developed on top of existing Spring Framework
• Spring Boot uses new model to make Java Development easy :
• Avoids some tedious development steps and boilerplate code and configuration
• Provides defaults for code and annotation configuration
• Follows Opinionated Defaults Configuration Approach
• Spring Boot Framework is not implemented from scratch :
• Rather it is implemented on top of existing Spring Framework
• Used to solve same problems like Spring Framework
3
Spring
Boot
Spring
Framework
Embedded
HTTP Servers
(Tomcat, Jetty)
XML<bean>
Configuration
or
@Configuration
= + -
Spring Boot
www.spiraltrain.nl
Advantages Spring Boot
• Easy to develop Spring Based applications with Java or Groovy :
• Reduces development time and increases productivity
• Avoids writing lots of boilerplate Code :
• Annotations and XML Configuration.
• Easy to integrate Spring Boot Applications with Spring Ecosystem :
• Like Spring JDBC, Spring ORM, Spring Data, Spring Security etc.
• Provides Embedded HTTP servers like Tomcat, Jetty etc. :
• Allows develop and test web applications very easily
• Provides CLI Command Line Interface tool :
• Allows develop and test Spring Boot Applications from command prompt easily
• Provides lots of plugins :
• Allows develop and test Spring Boot Applications easily using Maven and Gradle
• Allows working with embedded and in-memory Databases easily
4Spring Boot
www.spiraltrain.nl
Goal of Spring Boot
• Main goal of Spring Boot is to reduce Development time :
• Unit Test and Integration Test time
• Ease the development of Production ready web applications
• Spring Boot features that accomplish this :
• Avoid XML Configuration completely
• Avoid defining more Annotation Configuration :
• Combines existing Spring Framework Annotations to simple and single Annotation
• Avoid writing lots of import statements
• Provide some defaults to quick start new projects within no time
• Provide Opinionated Development approach
• Limitations of Spring Boot :
• Time consuming to convert Spring Framework projects into Spring Boot Applications
• However it is easy to create brand new/Greenfield Projects using Spring Boot
• Three approaches to start opiniated development :
• Spring Boot CLI Tool, Spring STS IDE, Spring Initializr Website
5Spring Boot
www.spiraltrain.nl
Spring Boot Flavors
• Two flavors of Spring-Based Applications using Spring Boot :
• Java-Based Applications and Groovy Applications
• Spring Boot Groovy Applications :
• Spring Boot CLI or Spring STS IDE or Spring Initializr Website
• Spring Initializr Website is found at: http://start.spring.io/
• Spring Boot Java Applications :
• Spring STS IDE or Spring Initializr Website
• Groovy is also JVM language almost similar to Java Language :
• Can combine both Groovy and Java into one Project
• Groovy files are finally compiled into *.class files with same byte code format
6
Java
*.java
Compiler
javac of groovyc
*.class files
Byte Code
Groovy
*.groovy
Spring Boot
www.spiraltrain.nl
Key Spring Boot Components
• Spring Boot Framework has mainly four major Components :
• Spring Boot Starters
• Spring Boot AutoConfigurator
• Spring Boot CLI
• Spring Boot Actuator
• In addition there are two more Spring Boot components :
• Spring Initilizr and Spring Boot IDEs
• Use Spring Initializr web interface at http://start.spring.io :
• To quick start new Spring Boot projects
7
CLI
Actuator
Autoconfigurator
Starter
Spring Boot
Components
Spring Boot
www.spiraltrain.nl
Spring Boot Starter
• Combines group of related dependencies in single dependency
• Example for Spring WebApplication with Tomcat WebServer :
• Need minimal jar dependencies in your Maven’s pom.xml :
• Spring core Jar file spring-core-xx.jar, Spring Web Jar file spring-web-xx.jar
• Spring Web MVC Jar file spring-webmvc-xx.jar ,Servlet Jar file servlet-xx.jar
• Need to add database related jars to add some database stuff :
• Spring JDBC Jar file spring-jdbc-xx.jar, Spring ORM Jar files spring-orm-xx.jar
• Spring Transaction Jar file spring-transaction-xx.jar
• Need to define lot of dependencies in build files :
• Very tedious and cumbersome tasks and also it increases our build file size
• Solution is to use Spring Boot Starter component :
• Spring Boot Starter component combines all related jars into single jar file
• We need to add one and only one jar file spring-boot-starter-web.jar file
• When adding spring-boot-starter-web.jar file dependency :
• Spring Boot downloads all required jars and adds them to project classpath
8Spring Boot
www.spiraltrain.nl
Starter Dependencies
• spring-boot-starter-logging jar file :
• Loads all it’s dependency jars to project classpath like :
• jcl-over-slf4j, jul-to-slf4j,log4j-over-slf4j, logback-classic
9
spring-boot-starter-web
spring-boot-starter
spring-web
spring-webmvc
spring-boot-starter-tomcat
spring-boot
spring-boot-autoconfigure
spring-boot-starter-logging
Tomcat-embed-core
Tomcat-embed-logging- juli
Spring Boot
www.spiraltrain.nl
Spring Boot AutoConfigurator
• Most of the Spring IO Platform Critics :
• Spring-based application requires lot of configuration either with XML or annotations
• Solution to this problem is Spring Boot AutoConfigurator :
• Don’t need to define XML configuration and almost no Annotation configuration
• Spring Boot AutoConfigurator component will take care of providing this information
• Spring MVC application using Spring IO Platform :
• Define lot of XML Configuration like views, view resolvers etc
• If using spring-boot-starter-web jar file in project build file :
• Spring Boot AutoConfigurator will resolve views, view resolvers etc. automatically
• Also Spring Boot reduces Annotation configuration :
• If we use @SpringBootApplication annotation at class level
• Spring Boot AutoConfigurator automatically adds required annotations to Java ByteCode
• Spring Boot Starter reduces build’s dependencies :
• Spring Boot AutoConfigurator reduces the Spring Configuration
• Spring Boot Starter triggers Spring Boot AutoConfigurator automatically
10Spring Boot
www.spiraltrain.nl
@SpringBootApplication
• Definition for @SpringBootApplication :
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Inherited
@Configuration
@EnableAutoConfiguration
@ComponentScan
public @interface SpringBootApplication
11
SpringBootApplication @Configuration @ComponentScan @EnableAutoConfiguration= + +
Spring Boot
www.spiraltrain.nl
Spring Boot CLI
• Spring Boot Command Line Interface :
• Spring Boot software to run and test Spring Boot applications from command line
• When running Spring Boot Applications through CLI :
• Internally uses Spring Boot Starter and Spring Boot AutoConfigurate components
• Spring Boot CLI introduced spring command :
• Execute Groovy Scripts from command prompt
spring run HelloWorld.groovy
• Can run Spring Web Applications with simple Spring Boot CLI Commands
• Spring Boot Framework internally uses Groovy :
• Add some defaults like Default import statements, Application main() method etc.
• Groovy language contains JAR Dependency Resolver :
• Resolves and add all required jar files to Groovy Project classpath
• Groovy Compiler groovyc :
• Will automatically add all default import statements then compile it
12Spring Boot
www.spiraltrain.nl
Spring Boot Internals
• Spring Boot Framework Programming model :
• Mainly inspired by Groovy Programming model
• Spring Boot Framework depends on two major components :
• Groovy and Grape
• Grape is an Embedded Dependency Resolution engine :
• JAR Dependency Manager embedded into Groovy
• Adds maven dependencies to project classpath to reduce build file definitions
13
Spring Boot
Groovy
Groovy’s Grape
Spring Boot
www.spiraltrain.nl
Spring Boot Actuator
• Spring Boot Actuator components major features are :
• Providing Management EndPoints to Spring Boot Applications.
• Spring Boot Applications Metrics
• For Spring Boot Web Application using CLI :
• Spring Boot Actuator provides hostname localhost and default port number 8080
• Application is accessed with http://localhost:8080/ end point
• Most common endpoints Boot provides out of the box :
• /health – Shows application health information
• /info – Displays arbitrary application info
• /metrics – Shows ‘metrics’ information for the current application
• /trace – Displays trace information by default the last few HTTP requests
• In order to get it working :
• Actuator requires Spring MVC to expose its endpoints through HTTP
• No other technology is supported
14Spring Boot
© copyright : spiraltrain@gmail.com
Summary : Spring Boot
• Spring Boot uses new model to make Java Development easy :
• Avoids some tedious development steps and boilerplate code and configuration
• Provides defaults for code and annotation configuration
• Follows Opinionated Defaults Configuration Approach
• Three approaches to start opiniated development :
• Spring Boot CLI Tool, Spring STS IDE, Spring Initializr Website
• Two flavors of Spring-Based Applications using Spring Boot :
• Java-Based Applications and Groovy Applications
• Spring Boot Framework has mainly four major Components :
• Spring Boot Starters, Spring Boot AutoConfigurator, Spring Boot CLI, Spring Boot Actuator
• Spring Boot Starters :
• Combines group of related dependencies in single dependency
• Spring Boot Framework depends on two major components :
• Groovy and Grape
Spring Intro 15
Exercises
Spring Boot
Ad

More Related Content

What's hot (20)

Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
Jakub Kubrynski
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
Jeevesh Pandey
 
Spring Core
Spring CoreSpring Core
Spring Core
Pushan Bhattacharya
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
Cheng Ta Yeh
 
Spring boot
Spring bootSpring boot
Spring boot
Gyanendra Yadav
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
tola99
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
Alex Movila
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
Jonathan Holloway
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
guest11106b
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jaran Flaath
 
Spring boot
Spring bootSpring boot
Spring boot
Bhagwat Kumar
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Hùng Nguyễn Huy
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
Santosh Kumar Kar
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 

Similar to Spring Boot (20)

Spring Boot Interview Questions PDF By ScholarHat
Spring Boot Interview Questions PDF By ScholarHatSpring Boot Interview Questions PDF By ScholarHat
Spring Boot Interview Questions PDF By ScholarHat
Scholarhat
 
Springboot - A milestone framework in Java Development
Springboot - A milestone framework in Java DevelopmentSpringboot - A milestone framework in Java Development
Springboot - A milestone framework in Java Development
Expeed Software
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your development
Strannik_2013
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец
Fwdays
 
SpringBoot
SpringBootSpringBoot
SpringBoot
Jaran Flaath
 
Spring boot wednesday
Spring boot wednesdaySpring boot wednesday
Spring boot wednesday
Vinay Prajapati
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
Strannik_2013
 
Module 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to beginModule 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to begin
Deepakprasad838637
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
🎤 Hanno Embregts 🎸
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
Marcus Hellberg
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
Ming-Ying Wu
 
ASP.net web api Power Point Presentation
ASP.net web api Power Point PresentationASP.net web api Power Point Presentation
ASP.net web api Power Point Presentation
BefastMeetingMinutes
 
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSEcadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
CHARANKUMARREDDYBOJJ
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
michaelaaron25322
 
Deep dive into share point framework webparts
Deep dive into share point framework webpartsDeep dive into share point framework webparts
Deep dive into share point framework webparts
Prabhu Nehru
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
Staples
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
Staples
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Spring Boot Interview Questions PDF By ScholarHat
Spring Boot Interview Questions PDF By ScholarHatSpring Boot Interview Questions PDF By ScholarHat
Spring Boot Interview Questions PDF By ScholarHat
Scholarhat
 
Springboot - A milestone framework in Java Development
Springboot - A milestone framework in Java DevelopmentSpringboot - A milestone framework in Java Development
Springboot - A milestone framework in Java Development
Expeed Software
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your development
Strannik_2013
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец
Fwdays
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
Strannik_2013
 
Module 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to beginModule 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to begin
Deepakprasad838637
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
🎤 Hanno Embregts 🎸
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
Ming-Ying Wu
 
ASP.net web api Power Point Presentation
ASP.net web api Power Point PresentationASP.net web api Power Point Presentation
ASP.net web api Power Point Presentation
BefastMeetingMinutes
 
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSEcadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
CHARANKUMARREDDYBOJJ
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
michaelaaron25322
 
Deep dive into share point framework webparts
Deep dive into share point framework webpartsDeep dive into share point framework webparts
Deep dive into share point framework webparts
Prabhu Nehru
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
Staples
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
Staples
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Ad

More from koppenolski (8)

Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
koppenolski
 
HTML Intro
HTML IntroHTML Intro
HTML Intro
koppenolski
 
Wicket Intro
Wicket IntroWicket Intro
Wicket Intro
koppenolski
 
R Intro
R IntroR Intro
R Intro
koppenolski
 
Python Intro
Python IntroPython Intro
Python Intro
koppenolski
 
SQL Intro
SQL IntroSQL Intro
SQL Intro
koppenolski
 
UML Intro
UML IntroUML Intro
UML Intro
koppenolski
 
Intro apache
Intro apacheIntro apache
Intro apache
koppenolski
 
Ad

Recently uploaded (20)

FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 

Spring Boot

  • 2. © copyright : [email protected] Course Schedule 2 • What is Spring Boot? • Advantages Spring Boot • Goal of Spring Boot • Spring Boot Flavors • Key Spring Boot Components • Spring Boot Starter • Starter Dependencies • Spring Boot Autoconfigurator • @SpringBootApplication • Spring Boot CLI • Spring Boot Internals • Spring Boot Actuator • Reflection • Annotations • Spring Core • Aspect Orientation • Groovy • Spring Boot
  • 3. www.spiraltrain.nl What is Spring Boot? • Spring Boot is completely new project from Spring Team : • Framework developed on top of existing Spring Framework • Spring Boot uses new model to make Java Development easy : • Avoids some tedious development steps and boilerplate code and configuration • Provides defaults for code and annotation configuration • Follows Opinionated Defaults Configuration Approach • Spring Boot Framework is not implemented from scratch : • Rather it is implemented on top of existing Spring Framework • Used to solve same problems like Spring Framework 3 Spring Boot Spring Framework Embedded HTTP Servers (Tomcat, Jetty) XML<bean> Configuration or @Configuration = + - Spring Boot
  • 4. www.spiraltrain.nl Advantages Spring Boot • Easy to develop Spring Based applications with Java or Groovy : • Reduces development time and increases productivity • Avoids writing lots of boilerplate Code : • Annotations and XML Configuration. • Easy to integrate Spring Boot Applications with Spring Ecosystem : • Like Spring JDBC, Spring ORM, Spring Data, Spring Security etc. • Provides Embedded HTTP servers like Tomcat, Jetty etc. : • Allows develop and test web applications very easily • Provides CLI Command Line Interface tool : • Allows develop and test Spring Boot Applications from command prompt easily • Provides lots of plugins : • Allows develop and test Spring Boot Applications easily using Maven and Gradle • Allows working with embedded and in-memory Databases easily 4Spring Boot
  • 5. www.spiraltrain.nl Goal of Spring Boot • Main goal of Spring Boot is to reduce Development time : • Unit Test and Integration Test time • Ease the development of Production ready web applications • Spring Boot features that accomplish this : • Avoid XML Configuration completely • Avoid defining more Annotation Configuration : • Combines existing Spring Framework Annotations to simple and single Annotation • Avoid writing lots of import statements • Provide some defaults to quick start new projects within no time • Provide Opinionated Development approach • Limitations of Spring Boot : • Time consuming to convert Spring Framework projects into Spring Boot Applications • However it is easy to create brand new/Greenfield Projects using Spring Boot • Three approaches to start opiniated development : • Spring Boot CLI Tool, Spring STS IDE, Spring Initializr Website 5Spring Boot
  • 6. www.spiraltrain.nl Spring Boot Flavors • Two flavors of Spring-Based Applications using Spring Boot : • Java-Based Applications and Groovy Applications • Spring Boot Groovy Applications : • Spring Boot CLI or Spring STS IDE or Spring Initializr Website • Spring Initializr Website is found at: http://start.spring.io/ • Spring Boot Java Applications : • Spring STS IDE or Spring Initializr Website • Groovy is also JVM language almost similar to Java Language : • Can combine both Groovy and Java into one Project • Groovy files are finally compiled into *.class files with same byte code format 6 Java *.java Compiler javac of groovyc *.class files Byte Code Groovy *.groovy Spring Boot
  • 7. www.spiraltrain.nl Key Spring Boot Components • Spring Boot Framework has mainly four major Components : • Spring Boot Starters • Spring Boot AutoConfigurator • Spring Boot CLI • Spring Boot Actuator • In addition there are two more Spring Boot components : • Spring Initilizr and Spring Boot IDEs • Use Spring Initializr web interface at http://start.spring.io : • To quick start new Spring Boot projects 7 CLI Actuator Autoconfigurator Starter Spring Boot Components Spring Boot
  • 8. www.spiraltrain.nl Spring Boot Starter • Combines group of related dependencies in single dependency • Example for Spring WebApplication with Tomcat WebServer : • Need minimal jar dependencies in your Maven’s pom.xml : • Spring core Jar file spring-core-xx.jar, Spring Web Jar file spring-web-xx.jar • Spring Web MVC Jar file spring-webmvc-xx.jar ,Servlet Jar file servlet-xx.jar • Need to add database related jars to add some database stuff : • Spring JDBC Jar file spring-jdbc-xx.jar, Spring ORM Jar files spring-orm-xx.jar • Spring Transaction Jar file spring-transaction-xx.jar • Need to define lot of dependencies in build files : • Very tedious and cumbersome tasks and also it increases our build file size • Solution is to use Spring Boot Starter component : • Spring Boot Starter component combines all related jars into single jar file • We need to add one and only one jar file spring-boot-starter-web.jar file • When adding spring-boot-starter-web.jar file dependency : • Spring Boot downloads all required jars and adds them to project classpath 8Spring Boot
  • 9. www.spiraltrain.nl Starter Dependencies • spring-boot-starter-logging jar file : • Loads all it’s dependency jars to project classpath like : • jcl-over-slf4j, jul-to-slf4j,log4j-over-slf4j, logback-classic 9 spring-boot-starter-web spring-boot-starter spring-web spring-webmvc spring-boot-starter-tomcat spring-boot spring-boot-autoconfigure spring-boot-starter-logging Tomcat-embed-core Tomcat-embed-logging- juli Spring Boot
  • 10. www.spiraltrain.nl Spring Boot AutoConfigurator • Most of the Spring IO Platform Critics : • Spring-based application requires lot of configuration either with XML or annotations • Solution to this problem is Spring Boot AutoConfigurator : • Don’t need to define XML configuration and almost no Annotation configuration • Spring Boot AutoConfigurator component will take care of providing this information • Spring MVC application using Spring IO Platform : • Define lot of XML Configuration like views, view resolvers etc • If using spring-boot-starter-web jar file in project build file : • Spring Boot AutoConfigurator will resolve views, view resolvers etc. automatically • Also Spring Boot reduces Annotation configuration : • If we use @SpringBootApplication annotation at class level • Spring Boot AutoConfigurator automatically adds required annotations to Java ByteCode • Spring Boot Starter reduces build’s dependencies : • Spring Boot AutoConfigurator reduces the Spring Configuration • Spring Boot Starter triggers Spring Boot AutoConfigurator automatically 10Spring Boot
  • 11. www.spiraltrain.nl @SpringBootApplication • Definition for @SpringBootApplication : @Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Inherited @Configuration @EnableAutoConfiguration @ComponentScan public @interface SpringBootApplication 11 SpringBootApplication @Configuration @ComponentScan @EnableAutoConfiguration= + + Spring Boot
  • 12. www.spiraltrain.nl Spring Boot CLI • Spring Boot Command Line Interface : • Spring Boot software to run and test Spring Boot applications from command line • When running Spring Boot Applications through CLI : • Internally uses Spring Boot Starter and Spring Boot AutoConfigurate components • Spring Boot CLI introduced spring command : • Execute Groovy Scripts from command prompt spring run HelloWorld.groovy • Can run Spring Web Applications with simple Spring Boot CLI Commands • Spring Boot Framework internally uses Groovy : • Add some defaults like Default import statements, Application main() method etc. • Groovy language contains JAR Dependency Resolver : • Resolves and add all required jar files to Groovy Project classpath • Groovy Compiler groovyc : • Will automatically add all default import statements then compile it 12Spring Boot
  • 13. www.spiraltrain.nl Spring Boot Internals • Spring Boot Framework Programming model : • Mainly inspired by Groovy Programming model • Spring Boot Framework depends on two major components : • Groovy and Grape • Grape is an Embedded Dependency Resolution engine : • JAR Dependency Manager embedded into Groovy • Adds maven dependencies to project classpath to reduce build file definitions 13 Spring Boot Groovy Groovy’s Grape Spring Boot
  • 14. www.spiraltrain.nl Spring Boot Actuator • Spring Boot Actuator components major features are : • Providing Management EndPoints to Spring Boot Applications. • Spring Boot Applications Metrics • For Spring Boot Web Application using CLI : • Spring Boot Actuator provides hostname localhost and default port number 8080 • Application is accessed with http://localhost:8080/ end point • Most common endpoints Boot provides out of the box : • /health – Shows application health information • /info – Displays arbitrary application info • /metrics – Shows ‘metrics’ information for the current application • /trace – Displays trace information by default the last few HTTP requests • In order to get it working : • Actuator requires Spring MVC to expose its endpoints through HTTP • No other technology is supported 14Spring Boot
  • 15. © copyright : [email protected] Summary : Spring Boot • Spring Boot uses new model to make Java Development easy : • Avoids some tedious development steps and boilerplate code and configuration • Provides defaults for code and annotation configuration • Follows Opinionated Defaults Configuration Approach • Three approaches to start opiniated development : • Spring Boot CLI Tool, Spring STS IDE, Spring Initializr Website • Two flavors of Spring-Based Applications using Spring Boot : • Java-Based Applications and Groovy Applications • Spring Boot Framework has mainly four major Components : • Spring Boot Starters, Spring Boot AutoConfigurator, Spring Boot CLI, Spring Boot Actuator • Spring Boot Starters : • Combines group of related dependencies in single dependency • Spring Boot Framework depends on two major components : • Groovy and Grape Spring Intro 15 Exercises Spring Boot