Pages

Sunday, July 7, 2013

Introduction to Spring

What is a Java?
Java is a programming language with a unique(almost) ability to run everywhere. It can run on any machine which has a Java Virtual Machine.

What are the major uses of Java?
Java can be used and is used for wide ranging applications from nornal desktop software, web software, games, OS(ex android). Large section of the applications developed are enterprise applications i.e. applications used by big enterprises at a huge level.

What is a framework?
An enterprise application has to do a lot of things like
- doing the stuff the enterprise wants it to do. For example, ticketing application for a bus service.
- data management of the user and the ticketing data/
- transaction management of the ticket transaction
To do these things an application
- should be robust i.e. should have minimum bugs
- should have capability to add further functionality
- should be easy to develop even with such tough demanding requirements.
- should be easy to develop for a large team without collaboration issues.
A framework provides the developers with these functionalities. It is like a guideline for development of applications. It includes its own code to do a lot of things like security transaction management etc for the developer, so that the developer can concentrate on the main business logic(ticketing in the example above). It lets developer to create components(short code capsule for a business function) which he can plug into the framework to create an application.

What is EJB framework?
EJB framework is a open source frame work based on JSR(Java specification request) used for development of enterprise application. It is(was till EJB3.0 came) a very heavy framework. A heavy framework implies that it was a strict framework where the developer had to do a lot of work other than writing plain old java objects(POJO). See old EJB2.0 code to understand how many interfaces and methods the developer had to right just to declare a bean(basic class which stores his application logic). Then there were too many types of beans (Session, entity, message) and deployment  descriptors thus bewildering the developer into a maze. The latest EJB3.0 has become a lot lightweight with annotation based POJO programming, still this blog is about Spring!!


What is Spring framework?
Spring framework is a light-weight framework for enterprise application development.It lets the developer to write his favourite POJO code and then by invoking the power of Dependency Injection and aspect oriented programming making it fairly simple for even an idiot like me to become an enterprise application developer.

How does Spring framework help?
As said above it makes development easy. It does so by following strategies:
- Lightweight and minimally invasive development with Plain Old Java Objects(POJOs)
- Loose coupling through dependency injection and interface orientation.
- Declarative programming through aspects and common conventions
- Boilerplate reduction through aspects and templates.

We will go through what these four strategies intend to do in the next blog.


No comments:

Post a Comment