Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




Spring Core


Benefits Of Using Spring
  1. Spring works on IOC (inversion of control) or DI (dependency injection) design pattern.

  2. Spring provides container to create and manage objects and also provides enterprise services to those objects.

  3. Spring is an open source application development framework.

  4. It provides components for different tiers of application e.g. web, middle/business and data access.


Different Modules In Spring
  1. Core container : BeanFactory, an implementation of the Factory pattern is an essential component of core container. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application's configuration and dependency specification from the actual application code.

  2. Spring context : Spring context comprise of configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as internalization, validation, JNDI, and scheduling functionality.

  3. Spring AOP : Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. Through AOP services like transaction control, logging etc can be easily managed.

  4. Spring DAO : Spring DAO makes it easy to work with relational database management systems on the Java platform using JDBC and object-relational mapping tools. Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections.

  5. Spring ORM : The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps.

  6. Spring Web module : Built on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.

  7. Spring MVC framework : Model-View-Controller (MVC) framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and assembles various view technologies including JSP, Tiles, iText, and POI.


The Spring container

In order to have a better understanding of spring we need to understand how spring works. Spring has gained it's popularity for Dependency Injection. Its only possible because Spring is a container of beans. You can imagine container like JVM. JVM is a container. When we create an object in java, it is the container or the JVM which is responsible to control the lifecycle of those objects.

Similarly Spring is a container. But it is a container of beans. It can contain as many objects as it wants. Those objects are completely managed by Spring, starting from creation to destruction.

Spring_Bean_Container