Core Concept of Spring by R4R Team

Core Concept of Spring:- Spring have some Important Core Concept as follows

1 IOC (or Dependency Injection) :

The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then responsible for hooking it all up.

i.e., Applying IoC, objects are given their dependencies at creation time by some external entity that coordinates each object in the system. That is, dependencies are injected into objects. So, IoC means an inversion of responsibility with regard to how an object obtains references to collaborating objects.

2 Aspect Oriented Programming(AOP):

AOP in spring allows cross cutting of concerns. AOP is not dependent on Spring’s IOC container. The key unit of modularity in OOP(Object Oriented Programming) is the class, whereas in AOP the unit of modularity is the aspect. Spring AOP is implemented in pure java and hence does not require a separate compilation process.

The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. Whereas DI helps you decouple your application objects from each other, AOP helps you decouple cross-cutting concerns from the objects that they affect.
The AOP module of Spring Framework provides aspect-oriented programming implementation allowing you to define method-interceptors and pointcuts to cleanly decouple code that implements functionality that should be separated.

The Spring Framework uses Spring AOP internally for transaction management, security, remote access, and JMX.
Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration:
1 schema-based approach 
2 @AspectJ-based annotation style.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!