CHARANKUMARREDDYBOJJ
13 views
22 slides
Jun 25, 2024
Slide 1 of 22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
About This Presentation
Introduction to Spring Boot
Spring Boot is a framework designed to simplify the development of new Spring applications. Built on top of the Spring Framework, Spring Boot offers a streamlined way to create stand-alone, production-ready applications. It achieves this by providing a set of default conf...
Introduction to Spring Boot
Spring Boot is a framework designed to simplify the development of new Spring applications. Built on top of the Spring Framework, Spring Boot offers a streamlined way to create stand-alone, production-ready applications. It achieves this by providing a set of default configurations and eliminating the need for extensive boilerplate code, making it a popular choice among developers for its ease of use and rapid development capabilities.
Evolution of Spring Framework
The Spring Framework revolutionized Java enterprise application development by providing a comprehensive programming and configuration model for modern Java-based enterprise applications. However, the extensive configuration required by Spring could be cumbersome, especially for new developers. This led to the inception of Spring Boot, which aims to ease the process of setting up, configuring, and deploying Spring applications.
Core Features of Spring Boot
1. Auto-Configuration
One of the hallmark features of Spring Boot is its ability to automatically configure your application based on the dependencies you have included. For instance, if you have the spring-boot-starter-web dependency in your project, Spring Boot will auto-configure components like the DispatcherServlet, Jackson (for JSON processing), and an embedded web server (Tomcat by default).
This auto-configuration reduces the amount of boilerplate code and XML configurations, allowing developers to focus on writing business logic rather than spending time on configuration.
2. Standalone Applications
Spring Boot applications are typically packaged as JAR files that include an embedded web server. This means you can run your application simply by executing the java -jar command. This standalone nature simplifies deployment and makes it easy to create microservices and cloud-native applications.
3. Production-Ready Features
Spring Boot includes several features that make it easier to manage and monitor applications in a production environment. These features include:
Health Checks: The /actuator/health endpoint provides information about the application's health status.
Metrics: The /actuator/metrics endpoint exposes various metrics related to the application's performance and resource utilization.
Externalized Configuration: Allows you to configure your application using properties files, YAML files, environment variables, and command-line arguments.
4. Spring Boot Starter POMs
Spring Boot simplifies dependency management by providing starter POMs. These are dependency descriptors that aggregate commonly used dependencies into a single, easy-to-include package. For example, the spring-boot-starter-web starter includes dependencies for Spring MVC, Jackson, and an embedded web server.
5. Spring Boot CLI
The Spring Boot CLI is a command-line tool that can be used to run Groovy scripts. This makes it easy to create prototypes and simple applications quickly. The CLI supports the same auto-configMM
Size: 1.37 MB
Language: en
Added: Jun 25, 2024
Slides: 22 pages
Slide Content
| CALLISTAENTERPRISE.SE
SPRING BOOT
MATS EKHAMMAR
2016-01-27
• Simple example
• What is Spring Boot?
• Demo application
• Jar!les
• Developer Tools
• Con!guration from con!g server
• Actuator
• Wrap up
AGENDA
2
• Simple example
- REST service
• Spring Boot CLI (Command Line Interface)
- Groovy !les
INTRODUCING SPRING BOOT
Spring yyy
con!g
props
Spring xxx
con!g
props
SPRING BOOT EMERGING
4
Spring Boot!
props
Spring Security
con!g
props
pom.xml
+
con!g
Spring Data
con!g
props
Spring Web
con!g
props props
pom.xml
• Helps creating Spring Applications
• Convention over con!guration
• Starter POMS
- Automatic con!guration with sensible defaults
- Example: spring-boot-starter-web
• Features
- Monitoring
- Metrics
- …
WHAT IS SPRING BOOT
5
• ”Getting started” the easy way quickly
• Check out new features in the Spring stack
• Minimal immediate knowledge of dependencies, con!guration, …
• Need to create small autonomous applications (microservices)
• Distributed system landscape
WHY – WHEN
6
• Rolling two dices
• REST endpoint
- /roll
• WEB page URL
- /rolling
• Eclipse STS (Spring Tool Suite)
DEMO APPLICATION
7
• demo-0.0.1-SNAPSHOT.jar
- big
• über-jar
• MANIFEST.MF
- Main-Class: org.springframework.boot.loader.JarLauncher
JAR FILES
8