SPRING is the most popular application development framework for Enterprise JAVA.
It aims for high performing, easily testable, and reusable code.
- First version written by Rod Johnson
- Was released under Apache 2.0 license
- Open Source and Cross Platform Framework
- Version 4.3 has been released on 10th June 2016.
Dependency Injection & Inversion of Control
Java components or classes should be independent as much as possible from other Java classes. The advantage of that is the re usability of the classes and the possibility of unit testing(testing classes independently). To decouple java components from other components, the dependencies of a certain class should be injected to them rather than that class creating or finding that object.
Consider the following instance......
Two classes are available as Class A and Class B
Class A uses Class B as a variable which means Class A has a dependency to Class B
If Dependency Injection(DI) is used, then Class B is given via the
- constructor of Class B => constructor injection
- setter => setter injection
The general concept behind the Dependency Injection (DI) is the Inversion of Control(IoC). It is a process by which dependencies are mentioned in the above mentioned containers and the Container then injects those dependencies when it creates the bean. This process is fundamentally the inverse, hence the name Inversion of Control (IoC),
Consider the following instance......
Two classes are available as Class A and Class B
Class A uses Class B as a variable which means Class A has a dependency to Class B
If Dependency Injection(DI) is used, then Class B is given via the
- constructor of Class B => constructor injection
- setter => setter injection
The general concept behind the Dependency Injection (DI) is the Inversion of Control(IoC). It is a process by which dependencies are mentioned in the above mentioned containers and the Container then injects those dependencies when it creates the bean. This process is fundamentally the inverse, hence the name Inversion of Control (IoC),
Modules
Spring is a one-spot shop place for the enterprise applications. It provides various types of software related requirements like database access,web related functionalities, software testing functionalities etc. These are supplied by the Spring framework through the unit of modules.
The Spring Framework provides about 20 modules. Following shows those modules.
As seen in the above figure, modules are present in several layers/containers. The main among these containers is the Core Layer which contain the modules providing the core functionalities of the Spring Framework. In addition to that Data Access/Integration Layer, Web Layer and Miscellaneous Layer are present. Testing module is included under the Miscellaneous Layer.
Now lets look at simple examples of usage of above mentioned modules. Web MVC is discussed as a separate blog post.
No comments:
Post a Comment