Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Spring Framework (Spring Boot (Definition (is a new way to create…
Java Spring Framework
Spring Boot
Features
Tools
Internal Tools
Maven
Gradle
External Tools
UNIX cURL
Spring Tool Suite (STS)
Definition
is a new way to create Spring applications with ease
link Spring Boot project:
https://spring.io/projects/spring-boot
is a project built on the top of the Spring framework
Spring Core
Spring IoC container
BeanFactory container
registry of different beans and their dependencies
read bean definitions and access them using the bean factory
has only six methods
The BeanFactory interface
implements
XmlBeanFactory class
XmlWebApplicationContext
BeanFactory
A BeanFactory is like a factory class that contains a collection of beans
instantiates the bean whenever asked for by clients
ApplicationContext container
adds more enterprise-specific functionality
the ability to resolve textual messages from a properties file
the ability to publish application events to interested event listeners
includes all functionality of the BeanFactory container
implementations
ClassPathXmlApplicationContext
WebXmlApplicationContext
FileSystemXmlApplicationContext
Bean
Create Bean
Using Static Factory Method
Using Instance Factory Method
Using Constructor
Bean Naming
Bean Instantiation Mode (bean scopes)
Request
Session
Prototype
Global-session
Singleton (default)
Thread
Bean Autowiring
byType
constructor
byName
autodetect
no (default)
Setting Bean Inheritance
Bean Lifecycle
Types of bean life cycle events
Post initialization callback methods
Pre destruction callback methods
*Aware interfaces for specific behavior
Custom init() and destroy() methods in bean configuration file
InitializingBean and DisposableBean callback interfaces
PostConstruct
and
PreDestroy
annotations
Lifecycle stages
use: calling the post-init method
destroy
initialize
Inversion of Control (IoC)
Inversion of control is a design paradigm
Modules make no assumptions about what other systems do but rely on their contracts
Every module can focus on what it is designed for
Decoupling of the execution of a certain task from implementation
Replacing modules has no side effect on other modules
implement IoC
Dependency Lookup / Service Locator (SL) Pattern
Dependency Injection (DI) Pattern
used to create instances of objects that other objects rely on without knowing at compile time which class will be used to provide that functionality
types
Setter Dependency Injection
Interface Dependency Injection
Constructor Dependency Injection
Factory Pattern