Spring is an open source, aspect oriented; dependency injection based light weight framework software to develop enterprise applications in java. Working with Spring is nothing but working with J2EE in framework style.
What is frame work?
Framework is software which develops the applications based on certain architecture having the ability of generating certain logic of the applications dynamically.
Spring framework software is given as an alternate to J2EE or extension for existing J2EE technologies like Servlets, JSP, EJB, and etc…
Project development using the framework software takes the less time because they generate certain logic of the applications dynamically.
What is the difference between dependency lookup and dependency Injection?
Once main object is ready, if main object performs search operations to get necessary dependency values then it is called dependency lookup.
If the underlying container or framework software creates main object and assign dependent values to main object without having any search operations is called dependency injection.
If the application gets jdbc connection object from jdbc connection pool manually by connecting jdbc connection pool, then it is called jdbc lookup.
If the container/framework software collects jdbc connection object from the pool and assign to main object automatically without having any search operations is called “Dependency Injection”.
High Level Architecture Diagram of Spring:
At high level Spring Contains the 7 modules:
Spring Core module is the base module for all other modules. It is providing the heart of the spring called Dependency Injection.
Spring Web and Spring MVC modules are given to develop the applications in framework style.
Spring Context module is given to develop the business components and distributed applications
Spring DAO module is given as an enhancement for JDBC programming.
Spring ORM module provides the setup that is required for the spring applications to interact with ORM application softwares like Hibernate.
Spring AOP module is given to work with additional/middleware services as configurable services for spring applications.
Difference between spring 2.0 and 2.5?
Spring 2.0 allows the xml based metadata programming where as spring 2.5 allows annotations based metadata programming.
Spring 2.0 is compatible with J2SE 1.4 and Spring 2.5 compatible with J2SE 1.5.
Features of Spring?
- Light weight framework software, due to this there is no need of application servers.
- Allows POJO/POJI model programming.
- Allows all types of java clients and suitable in any JAVA/J2EE programming environment.
- Gives alternate for J2EE technologies in framework style, so productivity is good.
- Gives support for inbuilt Connection pooling, transactions, logging and middleware services ... etc.
- Spring supports pluggable security service.
- Exception handling made easy ie. Maximum checked exceptions thrown by J2EE technologies are re-thrown as unchecked exceptions in spring environment.
- Most of the operations are declarative operations
- Spring Web, Spring Web MVC modules allows Free Maker, JSP, and Velocity as view layer.
- It allows the Aspect oriented programming.
- It provides the Dependency Injection.
- Able to interact with technologies like EJB, Hibernate, RMI….etc.
Difference between Struts Framework and Spring Framework?
Struts framework is given based on MVC architecture to just develop web applications. Spring framework is given based on IOC, MVC design patterns to develop different types of J2EE applications like Web Apps , Distributed apps, Business components, Persistence logic and user defined middle ware services … etc.