Search This Blog

Spring

What is Spring
                         The Spring Framework is a lightweight solution and a potential one-stop-shop for building your enterprise-ready applications.Spring is modular, allowing you to use only those parts that you need, without having to bring in the rest. You can use the IoC container, with Struts on top, etc. Spring is designed to be non-intrusive, meaning that your domain logic code generally has no dependencies on the framework itself.
Spring is a framework which handles the infrastructure so you can focus on your application logic development.Spring enables you to build applications from “plain old Java objects” (POJOs).
So, we can say that 
                   " Spring framework is a light weight open source java platform which enables developers to concentrate on application development  by providing the required infrastructure support."

Spring Modules: 
                                         There are around 20 modules in spring framework which are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, and Test, as shown in the following diagram.


Reference:http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/overview.html 


Ioc or DI : 
Inversion of control (IOC) or Dependency Injecction(DI) reffers to same process in which objects define their dependencies ( other objects on which they depend) i.e. other objects with which they work.


The org.springframework.beans and org.springframework.context packages are the basis for Spring Framework's IoC container.the BeanFactory interface provides the configuration framework and basic functionality, and the ApplicationContext adds more enterprise-specific functionality. The ApplicationContext is a complete superset of the BeanFactory.

What is Bean:
In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the dependencies among them, are reflected in the configuration metadata used by a container.

How Container works?
Application context works as IoC container(interface org.springframework.context.ApplicationContext) and does  configuration,instantiation and assembling beans.Configuration metadata provides the information to container to instantiate, configure, and assemble any particular object.onfiguration metadata wheras is represented in XML, Java annotations, or Java code. It allows you to express the objects that compose your application and the rich interdependencies between such objects.

Configuration metadata
Configuration metadata is traditionally supplied in a simple and intuitive XML format but not limited to.There are annotation based and java based configuration is also available.

The configuration metadata contains one or more bean definitions which container                     manages.XML-based Configuration metadata have these beans configured as <bean>             element under <beans> top level element.



 

No comments:

Post a Comment