Spring Tutorial

spring tutorial

Spring tutorial for beginners and professionals provides deep knowledge of Spring Framework. Spring system instructional exercise: This spring instructional exercise gives inside and out ideas of Spring Framework with improved samples. It was produced by Rod Johnson in 2003. Spring structure makes the simple advancement of JavaEE application. It is useful for novices and experienced persons.

Spring Framework

Spring is a lightweight system. It can be considered as a system of structures in light of the fact that it gives backing to different structures, for example, Struts, Hibernate, Tapestry, EJB, JSF and so forth. The system, in more extensive sense, can be characterized as a structure where we discover arrangement of the different specialized issues.

let us see what is Spring Framework, and why we need to work with this Spring.Spring is a light weight and open source framework created by Rod Johnson in 2003. Spring is a complete and a modular framework, its mean spring framework can be used for all layer implementations for a real time application or spring can be used for the development of particular support to various frameworks such as Struts, Hibernate, Tapestry, EJB, JSF etc. The framework, in broader sense, can be defined as a structure where we find solution of the various technical problems.

Spring framework is said to be a non-invasive means it doesn't force a programmer to extend or implement their class from any predefined class or interface given by Spring API, in struts we used to extend Action Class right that's why struts is said to be invasive

  • In case of struts framework, it will forces the programmer that, the programmer class must extend from the base class provided by struts API
  • Spring is light weight framework because of its POJO model
  • Spring Framework made J2EE application development little easier, by introducing POJO model

Spring having this much of demand because of the following 3 reasons

  • Simplicity -Spring framework is simple because as it is non-invasive, POJO and POJI model.
  • Testability - Actually for writing the spring application, server is not mandatory, but for struts applications we need a server, and for EJB too. If we want to test the application it may need lot of changes in the source and each time we must restart the server to view the changes, which is little tedious and time taking but we can over come this in Spring, for testing spring application server is not mandatory spring has it own container to run the applications. Spring can be used to develop any kind of java application, means we can developstarting from console application to enterprise level application
  • Loose Coupling -In spring objects are loosely coupled, this is the core concept of spring framework we will see in depth about this loose coupling and how its differ from tight coupling

Advantage of Dependency Injection

  • makes the code loosely coupled so easy to maintain
  • makes the code easy to test

Advantages of Spring Framework

There are many advantages of Spring Framework. They are as follows:

  1. Predefined Templates
  2. Loose Coupling
  3. Easy to test
  4. Lightweight
  5. Fast Development
  6. Powerful abstraction
  7. Declarative support

Predefined Templates

Spring system gives layouts to JDBC, Hibernate, JPA and so forth advances. So there is no compelling reason to compose a lot of code. It shrouds the essential strides of these advances.


Loose Coupling

The Spring applications are approximately coupled due to reliance infusion.


Easy to test

The Dependency Injection makes less demanding to test the application. The EJB or Struts application oblige server to run the application however Spring system doesn't oblige server.


Lightweight

Spring system is lightweight as a result of its POJO usage. The Spring Framework doesn't compel the developer to acquire any class or actualize any interface. That is the reason it is said non-obtrusive.


Fast Development

The Dependency Injection highlight of Spring Framework and it backing to different systems makes the simple advancement of JavaEE application.


Powerful reflection

It gives intense deliberation to JavaEE determinations, for example, JMS, JDBC, JPA and JTA.


Declarative backing

It gives explanatory backing to reserving, approval, exchanges and arranging.