Reputation: 3009
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.
Upvotes: 10
Views: 7085
Reputation: 340733
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.
Upvotes: 17
Reputation: 7807
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.
Upvotes: 1