Why we need Spring in our project?

Min Bùi
2 min readMay 18, 2021

I. Overview

My company is using Spring boot in Backend, Reactjs in Frontend, MySQL in main database, Redis for cache. So, why we use Spring boot in our project?

I found some numbers in here:

“Exactly 6 out of 10 people depend on the Spring Framework for the production of their application.”

“The server-side is still a Spring-dominated world, with half of the market using Spring Boot and almost a third using Spring MVC.”

Spring boot — 50%, Spring MVC —31%, JSF 11%, Vert.x 5%, Vaadin 5%, Struts 5%,…

It is clearly that Spring boot is the most popular framework in the world. Let look ahead to find out the reason.

II. Spring projects

Spring started out as an Inversion of Control (IoC) container for Java. It is the core of Spring and others project has develop on the top op IoC.

Spring framework devided into modules which may easy to pick some parts to user in our projects:

Spring architect, source https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/overview.html
Spring architect https://docs.spring.io/

If you are the newbie in Spring, I recommend you visit here to have more comprehension about Spring architect modules and concept.

Simply, Spring is a lightweight inversion of control and aspect-oriented container framework. Okay, that’s not so simple a description. But it does summarize what Spring does. To make more sense of Spring, let’s break this description down:

  • Lightweight
  • Inversion of control: Spring promotes “loose coupling” through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for themselves.
  • Aspect-oriented: Spring enables cohesive development by “separating application business logic from system services” (such as auditing and transaction management) Application objects do what they’re supposed to do — perform business logic — and nothing more. They are not responsible for (or even
    aware of) other system concerns, such as logging or transactional support
  • Container: Spring is a container in the sense that it contains and manages
    the life cycle and configuration of application objects. You can configure
    how your each of your beans should be created — either create one single
    instance of your bean or produce a new instance every time one is needed
    based on a configurable prototype — and how they should be associated
    with each other.

All of these attributes of Spring enable our to write code more clean, fast, flexible, manageable and easy to test. They are also a umbrella for a lot of modules integrated into larger Spring framework.

Its take some minutes (I actually spend 2h for this article). Its is 1h30 am now, I will go bed and think about Spring next :))).

Thank you for reading, see you later.

III. References:

--

--