Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Framework in simple terms

I've done some research on this, but still only have a vague understanding of it at best. Can anyone who is knowledgable on this give me a simple (or as simple as possible) description that someone with a basic understanding of programming could understand? Thanks for any help.

like image 995
Bryan Avatar asked Apr 16 '12 18:04

Bryan


People also ask

What is Spring Framework with example?

Spring is a powerful lightweight application development framework used for Java Enterprise Edition (JEE). In a way, it is a framework of frameworks because it provides support to various frameworks such as Struts, Hibernate, Tapestry, EJB, JSF, etc.

What is Spring Web framework?

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE (Enterprise Edition) platform.

Why is Spring Framework used?

Spring makes programming Java quicker, easier, and safer for everybody. Spring's focus on speed, simplicity, and productivity has made it the world's most popular Java framework.

What is the main principle for Spring Framework?

Spring Framework is based on two design principles - Dependency Injection and Aspect Oriented Programming.


2 Answers

Spring was built on top of the idea of dependency injection and inversion of control. In normal words - instead of having a bunch of classes creating each other and passing each other from one place to another you have a bag of beans. Each bean declares its dependencies (what services do I need to work?) and Spring container resolves this requirements by automatically and automagically wiring everything together.

You have a Service that says (through XML, annotations, constructor signature...) I need DAO interface to work! and Spring is kind enough to find some bean that implements that interface, create it first and pass where it is required.

On that foundation multiple other services were provided (mostly in terms of data access and AOP), but the injection is the core concept.

like image 74
Tomasz Nurkiewicz Avatar answered Oct 13 '22 14:10

Tomasz Nurkiewicz


If you want a quick and simple explanation then I can tell you that the heart of the Spring framework is the Inversion of control (IoC).

Naturally is reductive talk about Spring in 3 lines, but understand the IoC and you understand Spring. Everything is build around it in Spring.

like image 20
dash1e Avatar answered Oct 13 '22 13:10

dash1e