Spring Framwork Tutorials

Spring is an Open Source lightweight framework created by Rod Johnson. It works with all tier software application layers. It is non-invasive and handles the infrastructure so developer only focuses on their business logic. It is used to develop maintainable and reusable enterprise applications.  It provides very simple and rich facilities to integrate various frameworks technologies, and services in the application. Spring enables you to enjoy the key benefits of J2EE, while minimizing the complexity encountered by application code.

Features of Spring

  • The following are features of Spring framework -
  • Dependency Injection (DI)
  • Aspect Oriented Programming (AOP)
  • Transaction Management
  • Data Access using JDBC in Spring
  • JDBC Exception Handling
  • Integration with Hibernate, JDO, and iBATIS
  • Java Management Extension (JMX)
  • MVC Framework
  • Web Flow
  • Simplifying and integrating with J2EE
  • Remoting Support
  • Mail Support
  • Spring Security

New Features of Spring 3

  • Java 5 Support
  • Spring Expression Language (SpEL)
  • IoC enhancements/Java based bean metadata(annotation)
  • Object to XML mapping functionality (OXM) moved from Spring Web Services project
  • Dynamic Languages
  • Comprehensive REST support
  • @MVC additions
  • Declarative model validation
  • Early support for Java EE 6  

Dependency Injection (DI)

It is basic design principle on which the core spring framework works. It avoid writing unnecessary creation and lookup the bean in the container. It is Java beans-based configuration management to promote loose coupling in the framework and objects are given their dependencies by container instead of creating or looking for them manually.

AOP in Spring

One of the main feature on Spring uses to provide enterprise services in any tier of application using AOP. Using AOP you can introduce new features without modifying the existing business logics. It is used to weave cross-cutting functionalities or aspect into the code. It separates application business logic from System services like logging, transaction management and auditing.

Data access using Jdbc in Spring

The Spring framework provides a rich set of API for working with JDBC. The traditional JDBC code contains plumbing work, like – creating database connection, statements, execute the SQL queries and handling check exception related to SQL for performing any database operation. But Spring provides set of  classes/interfaces that take care of these tasks.

Object Relational Mapping (ORM) in Spring

Object Relational Mapping (ORM) is most popular framework in data persistence layer. The ORM API removes the complexities in traditional JDBC code in the OOPs fashion. The Spring framework provides a rich set of classes that make working with ORM framework very easy and simplify Hibernate application. Spring supports most of the ORM frameworks like – Hibernate, JPA, JDO, TopLink, iBATIS.

Transaction in Spring

One of the main reasons of the popularity of Enterprise Java Beans (EJB) is, to  use   transaction services in declarative fashion. But Spring provides the transactions on ordinary java POJO classes also. Spring provides programmatic and declarative transaction support in the applications.
  Next