Spring
Spring
Features Of Spring Framework
1. Lightweight:
Spring Framework is lightweight with respect to size and transparency.
2. Inversion Of Control (IOC):
In Spring Framework, loose coupling is achieved using Inversion of Control.
The objects give their own dependencies instead of creating or looking for dependent objects.
3. Aspect Oriented Programming (AOP):
By separating application business logic from system services, Spring Framework supports Aspect Oriented Programming and enables cohesive development.
3. Container:
Spring Framework creates and manages the life cycle and configuration of application objects.
4. MVC Framework:
Spring Framework is a MVC web application framework. This framework is configurable via interfaces and accommodates multiple view technologies.
5. Transaction Management:
For transaction management, Spring framework provides a generic abstraction layer. It is not tied to J2EE environments and it can be used in container-less environments.
6. JDBC Exception Handling:
The JDBC abstraction layer of the Spring Framework offers an exception hierarchy, which simplifies the error handling strategy.
7. Embedded database support:
8. Spring Boot
9. Spring Social
10. Spring Security
IOC:-
https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans
the Inversion of Control (IoC) [1] principle. IoC is also known as dependency injection (DI).
It is a process where by objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method.
The container then injects those dependencies when it creates the bean.This process is fundamentally the inverse, hence the name Inversion of Control (IoC), of the bean itself controlling the instantiation or location of its dependencies by using direct construction of classes, or a mechanism such as the Service Locator pattern.
Spring Bean Scopes:-
singleton: Scopes a single bean definition to a single object instance per Spring IoC container.
prototype : Scopes a single bean definition to any number of object instances.
request : Scopes a single bean definition to the lifecycle of a single HTTP request;
that is each and every HTTP request will have its own instance of a bean created off the back of a single bean definition. Only valid in the context of a web-aware Spring ApplicationContext.
session: Scopes a single bean definition to the lifecycle of a HTTP Session. Only valid in the context of a web-aware Spring ApplicationContext.
global session: Scopes a single bean definition to the lifecycle of a global HTTP Session. Typically only valid when used in a portlet context. Only valid in the context of a web-aware Spring ApplicationContext.
@Component – generic and can be used across application.
@Service – annotate classes at service layer level.
@Controller – annotate classes at presentation layers level, mainly used in Spring MVC.
@Repository – annotate classes at persistence layer, which will act as database repository.
Features Of Spring Framework
1. Lightweight:
Spring Framework is lightweight with respect to size and transparency.
2. Inversion Of Control (IOC):
In Spring Framework, loose coupling is achieved using Inversion of Control.
The objects give their own dependencies instead of creating or looking for dependent objects.
3. Aspect Oriented Programming (AOP):
By separating application business logic from system services, Spring Framework supports Aspect Oriented Programming and enables cohesive development.
3. Container:
Spring Framework creates and manages the life cycle and configuration of application objects.
4. MVC Framework:
Spring Framework is a MVC web application framework. This framework is configurable via interfaces and accommodates multiple view technologies.
5. Transaction Management:
For transaction management, Spring framework provides a generic abstraction layer. It is not tied to J2EE environments and it can be used in container-less environments.
6. JDBC Exception Handling:
The JDBC abstraction layer of the Spring Framework offers an exception hierarchy, which simplifies the error handling strategy.
7. Embedded database support:
8. Spring Boot
9. Spring Social
10. Spring Security
IOC:-
https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans
the Inversion of Control (IoC) [1] principle. IoC is also known as dependency injection (DI).
It is a process where by objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method.
The container then injects those dependencies when it creates the bean.This process is fundamentally the inverse, hence the name Inversion of Control (IoC), of the bean itself controlling the instantiation or location of its dependencies by using direct construction of classes, or a mechanism such as the Service Locator pattern.
Spring Bean Scopes:-
singleton: Scopes a single bean definition to a single object instance per Spring IoC container.
prototype : Scopes a single bean definition to any number of object instances.
request : Scopes a single bean definition to the lifecycle of a single HTTP request;
that is each and every HTTP request will have its own instance of a bean created off the back of a single bean definition. Only valid in the context of a web-aware Spring ApplicationContext.
session: Scopes a single bean definition to the lifecycle of a HTTP Session. Only valid in the context of a web-aware Spring ApplicationContext.
global session: Scopes a single bean definition to the lifecycle of a global HTTP Session. Typically only valid when used in a portlet context. Only valid in the context of a web-aware Spring ApplicationContext.
@Component – generic and can be used across application.
@Service – annotate classes at service layer level.
@Controller – annotate classes at presentation layers level, mainly used in Spring MVC.
@Repository – annotate classes at persistence layer, which will act as database repository.
Comments
Post a Comment