SpringBoot
SpringBoot
}
}
Definitions:
1. POJO: plain old java Object
2. Java Beans: Simple objects with only getters and setters.
3. Spring Beans: POJOs configured in the application Context
4. DTO (Data Transfer Objects): Beans used to move state
between layer.
5. Inversion of Control :
IoC provides mechanism of dependency Injection.
Application Context wraps the bean Factory which serves the
beans at the runtime of application.
Spring Boot provides auto-configuration of the Application
Context
Auto Configuration:
Default opinionated configuration.
Easy to override defaults
Configuration of presence.
Dependency Injection:
It is a design pattern that are used to remove the dependency from
the programming code.
It makes the loosely coupled and easy to test and maintain.
Let ‘s understand with the help of code:
Class Employee {
Address address;
Employee () {
Address = new Address (); //hardcoding
}
}
In this above case the Employee class is totally depends upon the
address (or) we can say it is tightly coupled.
In IOC Case,
Class Employee {
Address address;
Employee (Address address ){
this.address = address;
}
}
Spring IOC
Bean factory.
Application Context
References (They are not created in bean factory they are initialized).
Analysis of construction order.
Annotations
Native Support in java core.
Metadata for code
Often used compiler or runtime instructions.
Great leverage point for pointcuts.
Proxies
Beans in Bean Factory are proxied.
Annotations drives proxies
Annotations are easy extension points for your own abstracts too
UI LAYER productController
Business/Services productService
Layer
productDao
Data Access Layer
DB