Spring framework in java
Spring framework is an application framework, which used to develop various types of java, J2EE application. Spring framework is open source, lightweight, loosely coupled, aspect-oriented and dependency injection based java application framework.
open source: It is not only free software but its source code is also exposed to the programmer along with installation.
lightweight: Spring containers are lightweight container because they can be activated anywhere by just creating an object for certain pre-defined classes.
loosely coupled: If a degree of dependency is less between two component then we can say the components are loosely coupled.
aspect-oriented: Divided program into several parts as primary logic, secondary logic, and middleware logic to make the program easy to develop and understand.
dependency injection: The underlying web container or server software assigns values to the resource automatically or dynamically. Ex: Constructor.
Seven Module of Spring
- The Core container module
- Application context module
- AOP module (Aspect Oriented Programming)
- JDBC abstraction and DAO module
- O/R mapping integration module (Object/Relational)
- Web module
- MVC framework module
The basic container:
The main container provides essential features of the Spring framework. The main component of the main container is BeanFactory, an implementation of the Factory model. BeanFactory applies the Inversion of Control (IOC) template to separate the application configuration and dependency specification from the actual application code.
The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, email, internalization, validation, and planning.
The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management function. As a result, you can easily enable AOP for any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring application. With Spring AOP, you can integrate declarative transaction management with your applications without using EJB components.
The JDBC Spring DAO Abstraction Layer provides a significant exception hierarchy for managing exception handling and error messages issued by different database providers. The exception hierarchy simplifies error handling and dramatically reduces the amount of exception code to write, such as opening and closing connections. The Spring DAO JDBC exceptions conform to its generic DAO exception hierarchy.
The Spring framework connects to multiple ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these elements are consistent with Spring’s generic transaction and DAO hierarchies.
Spring Web Module:
The Web Context Module is based on the Application Context Module, providing contexts for web applications. Therefore, the Spring framework supports integration with Jakarta Struts. The Web module also facilitates multi-part query management and binding of request parameters to domain objects.
The Model-View-Controller Framework (MVC) is a complete MVC implementation for creating Web applications. The MVC framework is highly configurable via strategic interfaces and supports many display technologies including JSP, Velocity, Tiles, iText, and POI.
- Depends-on in spring example
- p namespace and c namespace in spring
- Simple Spring Program with an example
- Spring framework in java
- Bean definition inheritance in Spring
- Spring Autowired with example
- Collection Framework in java
- HashMap in java example
- HashSet in java example
- Treeset in java with Example
- Lambda Expressions in Java with Example
- Access Specifiers in Java Example
- Exception handling in java
- ArrayList in java example
- Basic sql queries examples
- Hibernate Application Saving Object
- Java programs for practice