Search This Blog

Friday, July 1, 2011

My brief understanding of Spring Framework

What is Spring Framework, and how do we start with it? This is always a question for beginners. I ask this question when I started to learn it a few years ago. First thought I got was to open www.springsource.com, it is a big website containing a lot of information. But, where is the answer I am looking for?
I made a few clicks now; here is what I found,
Spring is a popular and widely deployed open source framework that helps developers build high quality applications faster. Spring provides a consistent programming and configuration model that is well understood and used by millions of developers worldwide. Unlike the traditional Java EE platform, Spring provides a range of capabilities for creating enterprise Java, rich web, and enterprise integration applications that can be consumed in a lightweight, a-la-carte manner.
I got confused, did you? I am trying to translate this paragraph a bit more straight forward, so it can be more understandable for me at least. Let me start with a metaphor,
Suppose you went into a 2 star hotel, then you get a bed, a shared bath room, that’s probably all.
What if you want to have dinner, you have to get out and buy it in nearby food stand.
If you want to have spa, you have to get out again and went to a spa shop.
Here the hotel is like a server. If the server does not provide out of box modules as MVC, IOC, Data Access, Transaction Management etc, and if you want to have these extra services you have to either code from scratch or import these modules from outside of the server, or maybe find another server which provides some of these modules (a 5 star Hotel).

Spring Framework is just like a well prepared box, which contains the extra value added java modules. After you put Spring Framework jars and configuration files on the server path, you can start using these modules by following certain configuration and coding rules. Since these modules are mostly independent of each other, you can pick as many modules to use as necessary, or even none of them. If the modules of Spring  Framework cannot serve all your needs, you can import modules from other places too.

No comments:

Post a Comment