Spring Framework

Published on August 3, 2022


Spring Framework

While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

Spring Framework is one of the most popular Java EE frameworks. In this article, we will learn about the following:

  • Spring framework architecture
  • Core components of Spring
  • Various projects under the spring framework umbrella.

I looked at the Google Trends chart for Spring Framework, Servlet, JSP, and JSF. It’s clear that Spring is far ahead from all other Java EE technologies.

Spring Framework Popularity
Spring Framework - Google Trends

What is Spring Framework?

Spring is one of the most popular frameworks for Java enterprise edition. Developers all over the world use Spring for developing reliable and high-quality applications. The spring framework was designed by Rod Johnson. Since then Spring has become an alternative technology in Java world for the EJB model. You can create different kinds of applications using the spring framework.

Spring Core Concepts - DI, IoC, AOP

  • It is impossible to understand what is Spring Framework without understanding what is Dependency Injection and Inversion of Control. Dependency Injection also called as DI, is one of the types of Inversion of Control (IoC).
  • Inversion of Control - this is the principle of object-oriented programming, in which objects of the program do not depend on concrete implementations of other objects, but may have knowledge about their abstractions (interfaces) for later interaction.
  • Dependency Injection - is a composition of structural design patterns, in which for each function of the application there is one, a conditionally independent object (service) that can have the need to use other objects (dependencies) known to it by interfaces. Dependencies are transferred (implemented) to the service at the time of its creation. This is a situation where we introduce an element of one class into another. In practice, DI is implemented by passing parameters to the constructor or using setters. Libraries that implement this approach are also called IoC containers.
  • Aspect oriented programming - a programming paradigm that allows you to distinguish cross-through (functional) functionality in application. These functions, which span multiple application nodes, are called cross-cutting concerns and these cross-cutting notes are separated from the immediate business logic of the application. In OOP, the key unit is the class, while in AOP, the key element is the aspect. DI helps to separate application classes into separate modules, and AOP helps to separate cross-cutting concerns from the objects they affect.

Spring Framework Architecture

Spring Framework is divided into a number of separate modules, which allows you to decide which ones to use in your application. The below image illustrates the most important modules of Spring Framework architecture. spring framework architecture Let’s look into spring ecosystem modules one by one.

Spring Framework Core Components

The Core container from Spring consists of four modules: SpEL , Context, Core, Beans. Description for these elements are as follows:

  1. The SpEL module provides a powerful expression language for manipulating objects during execution.
  2. Context is built on the basis of Beans and Core and allows you to access any object that is defined in the settings. The key element of the Context module is the ApplicationContext interface.
  3. The Core module provides key parts of the framework including IoC and DI properties.
  4. The Bean module is responsible for creating and managing Spring Beans - is application context structure unit.

Spring Framework Web

Spring framework Web layer consists of Web, Web-MVC, Web-Socket, Web-Portlet etc.

  1. The Web module provides functions such as downloading files, creating web application, rest web service etc.
  2. Web-MVC contains a Spring MVC implementation for web applications.
  3. Web-Socket provides support for communication between the client and the server, using Web-Sockets in web applications.
  4. Web-Portlet provides MVC implementation with portlet environment

Spring Framework Data Access

The Data Access/Integration container consists of JDBC, ORM, OXM, JMS and the Transactions module.

  1. JDBC provides an abstract layer of JDBC and eliminates the need for the developer to manually register the monotonous code associated with connecting to the database.
  2. Spring ORM provides integration with popular ORMs such as Hibernate, JDO, which are implementations of JPA.
  3. The OXM module is responsible for linking the Object / XML - XMLBeans, JAXB, etc.
  4. The JMS (Java Messaging Service) module is responsible for creating, sending and receiving messages.
  5. Transactions supports transaction management for classes that implement certain methods and POJOs.

Miscellaneous Modules

Spring also includes a number of other important modules, such as AOP, Aspects, Instrumentation, Messaging, and Test.

  1. AOP implements aspect-oriented programming and allows using the entire arsenal of AOP capabilities.
  2. The Aspects module provides integration with AspectJ, which is also a powerful AOP framework.
  3. Instrumentation is responsible for supporting class instrumentation and class loader, which are used in server applications.
  4. The Messaging module provides STOMP support.
  5. Finally, the Test module provides testing using TestNG or the JUnit Framework.

Spring 5 Features

Spring 5 brought massive update to Spring 4. Some of the important features of Spring 5 are:

  1. Support for Java 8, Java 9, Java EE 7, Java EE 8, Servlet 4.0, Bean Validation 2.0, and JPA 2.2. I am happy to see that Spring is trying to catch up with latest versions of major technologies being used.
  2. Improved Logging with new module - spring-jcl.
  3. File operations are using NIO 2 streams, hence improved performance.
  4. Support for Reactor 3.1 Flux and Mono as well as RxJava 1.3 and 2.1 as return values from Spring MVC controller methods.
  5. Support for Kotlin, Project Lombok, JSON Binding API as an alternative to Jackson and GSON.
  6. Spring WebFlux - Spring getting Reactive.
  7. Support for JUnit 5
  8. Functional programming support through Kotlin.

You can checkout Spring Projects on our GitHub Repository.

References: Spring Official Website, Spring Reference Documentation

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the authors
Default avatar


Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
DigitalOcean Employee
DigitalOcean Employee badge
May 24, 2020

Hello, Why is JPA included in the list of ORM tools in this article? JPA is a specification it is not a ORM tool/ framework.

- Deepthi

    DigitalOcean Employee
    DigitalOcean Employee badge
    January 1, 2020

    Follow Up Question/Clarity: My Question is based specifically on the comparison between JQuery5 and Spring5 with its 7 Features (or Spring4 with its 5 Feautres). jQuery5 has 11 Features that which I feel there are most powerful. I did proper investigative discovery not just counting.

    - Alpheus Legoke Mokgalaka

      DigitalOcean Employee
      DigitalOcean Employee badge
      January 1, 2020

      Yes, I do agree with you. The Basics of C++ (OOPL/Object-Oriented Design/Model) and then followed by proper skill (relevant expertise) in the usage of JQuery Features, could help anyone in mastering any Framework. I’m still mummed why many people use Spring Framework than JQuery (DOM tree) Framework, even though JQuery demonstrates to be easier to use (user-friendly) with its powerful features and had been availabe on the Market maybe even prior to the Spring Framework’s release. Could you elaborate maybe if I missed the power of Spring Framework with its 5 Features that might make it so powerful??

      - Alpheus Legoke Mokgalaka

        DigitalOcean Employee
        DigitalOcean Employee badge
        February 5, 2019

        Hi, You have great tutorials. But I do not see any tutorial on how to use an IDE to create and run a simple Spring tutorial. Is there one?


          DigitalOcean Employee
          DigitalOcean Employee badge
          July 23, 2018

          Hello Please create a tutorial for Maven. thanks

          - Sina

            DigitalOcean Employee
            DigitalOcean Employee badge
            May 21, 2018

            Hello is there any tutorial for SpEL THANKS

            - Sameh

              DigitalOcean Employee
              DigitalOcean Employee badge
              November 29, 2017

              Number one Java learning platform.

              - Yash

                Try DigitalOcean for free

                Click below to sign up and get $200 of credit to try our products over 60 days!

                Sign up

                Join the Tech Talk
                Success! Thank you! Please check your email for further details.

                Please complete your information!

                Featured on Community

                Get our biweekly newsletter

                Sign up for Infrastructure as a Newsletter.

                Hollie's Hub for Good

                Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

                Become a contributor

                Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

                Welcome to the developer cloud

                DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

                Learn more
                DigitalOcean Cloud Control Panel