SlideShare a Scribd company logo
1 of 25
Download to read offline
v
SPRING FRAMEWORK
Nguyễn Việt Đức - 2018/09/21
Contents
1. Overview
2. History
3. Goals
4. Design Philosophy
5. Spring Core
6. Spring Security, data, boot
Overview
Spring Framework is a powerful lightweight application development framework
used for Enterprise Java (JEE)
It provides everything you need to embrace the Java language in an
enterprise environment, with support for Groovy and Kotlin as alternative
languages on the JVM, and with the flexibility to create many kinds of
architectures depending on an application’s needs
Spring aims to help structure whole applications in a consistent, productive
manner, pulling together best-of-breed single-tier frameworks to create a
coherent architecture.
Goals
1. Simplicity: Spring Framework is simple because its non-invasive as it
uses POJO and POJI models.
2. Testability: Code split into modules make it easy to test.
3. Loosely coupling: Because Dependency Injection.
Goals
Lets understand this with an example:
public interface Bike {
public void start();
}
class Rider {
Bike b;
public void setBike(Bike b) {
this.b = b;
}
void ride() { b.start(); }
}
Goals
The Spring framework is a layered architecture which consists of several
modules, consists of features organized into about 20 modules.
All built on the top of its core container.
Goals
Documents at:
Current version of spring framework
Modules Project
Spring Core
1. The interface org.springframework.context.ApplicationContext represents the
Spring IoC container and is responsible for instantiating, configuring and
assembling objects known as beans, as well as managing their lifecycle.
The Spring framework provides several implementations of the ApplicationContext
interface — ClassPathXmlApplicationContext and FileSystemXmlApplicationContext
for standalone applications, and WebApplicationContext for web applications.
Spring Core
Spring Core
1. DI: Dependency injection is a pattern through which to implement IoC, where the
control being inverted is the setting of object’s dependencies.
The act of connecting objects with other objects or “injecting” objects into
other objects, is done by an assembler rather than by the objects themselves.
Traditional programming: With DI:
Spring Core
1. Exist in two major variants:
• Constructor injection: Examples by code/xml
• Setter injection: Examples by code/xml
Spring Core
1. Spring Bean: Any object in the Spring framework that we initialize through Spring container
is called Spring Bean.
2. There are five scopes defined:
a. singleton (default) – Only one instance of the bean will be created for each container.
This is the default scope for the spring beans. While using this scope, make sure bean
doesn’t have shared instance variables otherwise it might lead to data inconsistency
issues.
b. prototype – A new instance will be created every time the bean is requested.
c. request – This is same as prototype scope, however it’s meant to be used for web
applications. A new instance of the bean will be created for each HTTP request.
d. session – A new bean will be created for each HTTP session by the container.
e. global-session – This is used to create global session beans for Portlet applications.
3. Spring Bean Configuration:
a. XML Based Configuration – By creating Spring Configuration XML file to configure the
beans. If you are using Spring MVC framework, the xml based configuration can be loaded
automatically by writing some boiler plate code in web.xml file.
b. Java Based Configuration – Starting from Spring 3.0, we can configure Spring beans using
java programs. Some important annotations used for java based configuration are
@Configuration, @ComponentScan and @Bean.
Spring Bean
Spring annotation cheat sheet
Spring Expression Language
The Spring Expression Language (SpEL) is a powerful expression language that
supports querying and manipulating an object graph at runtime. It can be used with
XML or annotation-based Spring configurations.
There are several operators available in the language:
Type Operators
Arithmetic +, -, *, /, %, ^, div, mod
Relational <, >, ==, !=, <=, >=, lt, gt, eq, ne, le, ge
Logical and, or, not, &&, ||, !
Conditional ?:
Regex matches
Documents here
Project Example (Need to pull the root first, then follow guide line)
Spring Security
Spring MVC Security
Spring Boot OAuth2 Security
Spring Security - Example
Spring Data
Spring Data
Overview, modules, features, quickstart
Reference
Spring Data - Documents, Reference
Spring Boot
1. Spring Boot makes it easy to create stand-alone, production-grade Spring based
Applications that you can "just run".
2. Features:
a. Create stand-alone Spring applications
b. Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
c. Provide opinionated 'starter' dependencies to simplify your build
configuration
d. Automatically configure Spring and 3rd party libraries whenever possible
e. Provide production-ready features such as metrics, health checks and
externalized configuration
f. Absolutely no code generation and no requirement for XML configuration
3. Examples:
a. Guideline
b. Project Example
References
https://spring.io/projects/spring-boot
https://springframework.guru/spring-framework-annotations/
https://www.baeldung.com/inversion-control-and-dependency-injection-in-spring
https://spring.io/guides/topicals/spring-security-architecture/

More Related Content

What's hot

Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsVirtual Nuggets
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)ASIMYILDIZ
 
Introduction to Ibatis by Rohit
Introduction to Ibatis by RohitIntroduction to Ibatis by Rohit
Introduction to Ibatis by RohitRohit Prabhakar
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...Edureka!
 
Java spring framework
Java spring frameworkJava spring framework
Java spring frameworkRajiv Gupta
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit Gupta
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & SpringDavid Kiss
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring FrameworkEdureka!
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkRaveendra R
 
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Edureka!
 

What's hot (20)

Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
 
Java spring ppt
Java spring pptJava spring ppt
Java spring ppt
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)
 
Introduction to Ibatis by Rohit
Introduction to Ibatis by RohitIntroduction to Ibatis by Rohit
Introduction to Ibatis by Rohit
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Spring Framework Rohit
Spring Framework RohitSpring Framework Rohit
Spring Framework Rohit
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
 
Java spring framework
Java spring frameworkJava spring framework
Java spring framework
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
 

Similar to Spring framework

Spring (1)
Spring (1)Spring (1)
Spring (1)Aneega
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malavRohit malav
 
Spring framework Introduction
Spring framework  IntroductionSpring framework  Introduction
Spring framework IntroductionAnuj Singh Rajput
 
Spring core module
Spring core moduleSpring core module
Spring core moduleRaj Tomar
 
Learn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionLearn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionMarshallChabaga
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkASG
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkDineesha Suraweera
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptxNourhanTarek23
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?NexSoftsys
 
The Complete Spring Tutorial
The Complete Spring TutorialThe Complete Spring Tutorial
The Complete Spring Tutorialcribes
 
Spring Architecture | Advanced Java
Spring Architecture | Advanced JavaSpring Architecture | Advanced Java
Spring Architecture | Advanced JavaVISHAL DONGA
 
Spring framework
Spring frameworkSpring framework
Spring frameworkKani Selvam
 
TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFrameworkShankar Nair
 
스프링 프레임워크
스프링 프레임워크스프링 프레임워크
스프링 프레임워크Yoonki Chang
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 

Similar to Spring framework (20)

Spring Basics
Spring BasicsSpring Basics
Spring Basics
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malav
 
Spring framework Introduction
Spring framework  IntroductionSpring framework  Introduction
Spring framework Introduction
 
Spring core module
Spring core moduleSpring core module
Spring core module
 
Learn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionLearn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - Intoduction
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptx
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
 
Spring notes
Spring notesSpring notes
Spring notes
 
Spring session
Spring sessionSpring session
Spring session
 
The Complete Spring Tutorial
The Complete Spring TutorialThe Complete Spring Tutorial
The Complete Spring Tutorial
 
Spring 2
Spring 2Spring 2
Spring 2
 
Spring Architecture | Advanced Java
Spring Architecture | Advanced JavaSpring Architecture | Advanced Java
Spring Architecture | Advanced Java
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Springs_Training
Springs_TrainingSprings_Training
Springs_Training
 
TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFramework
 
스프링 프레임워크
스프링 프레임워크스프링 프레임워크
스프링 프레임워크
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 

Recently uploaded

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 

Recently uploaded (20)

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Spring framework

  • 2.
  • 3.
  • 4.
  • 5. Contents 1. Overview 2. History 3. Goals 4. Design Philosophy 5. Spring Core 6. Spring Security, data, boot
  • 6. Overview Spring Framework is a powerful lightweight application development framework used for Enterprise Java (JEE) It provides everything you need to embrace the Java language in an enterprise environment, with support for Groovy and Kotlin as alternative languages on the JVM, and with the flexibility to create many kinds of architectures depending on an application’s needs Spring aims to help structure whole applications in a consistent, productive manner, pulling together best-of-breed single-tier frameworks to create a coherent architecture.
  • 7. Goals 1. Simplicity: Spring Framework is simple because its non-invasive as it uses POJO and POJI models. 2. Testability: Code split into modules make it easy to test. 3. Loosely coupling: Because Dependency Injection.
  • 8. Goals Lets understand this with an example: public interface Bike { public void start(); } class Rider { Bike b; public void setBike(Bike b) { this.b = b; } void ride() { b.start(); } }
  • 9. Goals The Spring framework is a layered architecture which consists of several modules, consists of features organized into about 20 modules. All built on the top of its core container.
  • 10. Goals Documents at: Current version of spring framework Modules Project
  • 12. 1. The interface org.springframework.context.ApplicationContext represents the Spring IoC container and is responsible for instantiating, configuring and assembling objects known as beans, as well as managing their lifecycle. The Spring framework provides several implementations of the ApplicationContext interface — ClassPathXmlApplicationContext and FileSystemXmlApplicationContext for standalone applications, and WebApplicationContext for web applications. Spring Core
  • 14. 1. DI: Dependency injection is a pattern through which to implement IoC, where the control being inverted is the setting of object’s dependencies. The act of connecting objects with other objects or “injecting” objects into other objects, is done by an assembler rather than by the objects themselves. Traditional programming: With DI: Spring Core
  • 15. 1. Exist in two major variants: • Constructor injection: Examples by code/xml • Setter injection: Examples by code/xml Spring Core
  • 16. 1. Spring Bean: Any object in the Spring framework that we initialize through Spring container is called Spring Bean. 2. There are five scopes defined: a. singleton (default) – Only one instance of the bean will be created for each container. This is the default scope for the spring beans. While using this scope, make sure bean doesn’t have shared instance variables otherwise it might lead to data inconsistency issues. b. prototype – A new instance will be created every time the bean is requested. c. request – This is same as prototype scope, however it’s meant to be used for web applications. A new instance of the bean will be created for each HTTP request. d. session – A new bean will be created for each HTTP session by the container. e. global-session – This is used to create global session beans for Portlet applications. 3. Spring Bean Configuration: a. XML Based Configuration – By creating Spring Configuration XML file to configure the beans. If you are using Spring MVC framework, the xml based configuration can be loaded automatically by writing some boiler plate code in web.xml file. b. Java Based Configuration – Starting from Spring 3.0, we can configure Spring beans using java programs. Some important annotations used for java based configuration are @Configuration, @ComponentScan and @Bean. Spring Bean
  • 18. Spring Expression Language The Spring Expression Language (SpEL) is a powerful expression language that supports querying and manipulating an object graph at runtime. It can be used with XML or annotation-based Spring configurations. There are several operators available in the language: Type Operators Arithmetic +, -, *, /, %, ^, div, mod Relational <, >, ==, !=, <=, >=, lt, gt, eq, ne, le, ge Logical and, or, not, &&, ||, ! Conditional ?: Regex matches Documents here Project Example (Need to pull the root first, then follow guide line)
  • 20. Spring MVC Security Spring Boot OAuth2 Security Spring Security - Example
  • 23. Overview, modules, features, quickstart Reference Spring Data - Documents, Reference
  • 24. Spring Boot 1. Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". 2. Features: a. Create stand-alone Spring applications b. Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files) c. Provide opinionated 'starter' dependencies to simplify your build configuration d. Automatically configure Spring and 3rd party libraries whenever possible e. Provide production-ready features such as metrics, health checks and externalized configuration f. Absolutely no code generation and no requirement for XML configuration 3. Examples: a. Guideline b. Project Example