1. What is Spring
Spring is an open-source Framework who simplifies development complexities of java-based enterprise applications. It provides infrastructural support at application level so that developers can focus only on business logic.2. Framework of frameworks
Also Spring can be thought as a framework for frameworks" because Spring supports and facilitate using a wide range of frameworks such as Hibernate, Struts, etc.3. Spring Main Approach
Spring at its core, is a dependency injection container which is a pattern for developing decoupled applications. For example if you want to has an object of class4. Spring Magic
Now it's time to understand how Spring simplifies development process. Spring introduces a descriptive and conventional way in which developer can determine how things must be wired together. For better understanding below is an example for inject dependency using XML while using Spring:
1 2 3 4 5 |
<bean id="myInterface" class="ClassA" /> <bean class="ClassB"> <property name="myInterface" ref="myInterface" /> </bean> |
1 2 |
@Autowired private MyInterface myInterface; |