Spring Framework Architecture ( as per Spring 4.0 Doc )
The Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications, It is lightweight solution and a potential one-stop-solution for building enterprise-ready applications. Spring enables us to build applications from “plain old Java objects” (POJOs) and to apply enterprise services non-invasively to POJOs. However, Spring is modular, which allow us to use only those parts that you need in our application, and leave what we don’t require. It helps us to focus on the core application logic and Spring will take care the infrastructure part.
For details about the Spring Framework please have a look on the Release Doc.
Spring Release History
Spring Framework was written by Rod Johnson in 2002, and the first milestone of spring 1.0 released under Apache 2.0 license in 2004.Spring version 1.0 released on 2004; Spring version 2.0 released on 2006
Spring version 3.0 released on 2009; Spring version 4.0 released on December 2013, with support for Java SE 8, Groovy 2, some aspects of Java EE7, and Web Sockets. Spring 4.0 needs Java SE 6 or higher.
Spring Core Containers
Spring application consists of Plain Old Java Objects(POJOs) and their associate, And the central component of a spring application is the Container. Spring provide two interface that act as containers, namely BeanFactory and ApplicationContext. Technically BeanFactory and ApplicationContext are interfaces provided by Spring, but they are normally referred to as Containers.
The org.springframework.beans.factory.BeanFactory container is the root container that loads all the beans and provides dependency injection to enterprise application.
BeanFactory factory = new XmlBeanFactory(new ClasspathResource("beans.xml"));
//getBean() method can be used to access a perticular bean by specifying its id.
BeanClassName instance = (BeanClassName) factory.getBean("idOfTheBean");
org.springframework.context.ApplicationContext container that extends the BeanFactory container with various enterprise-level feature, as
- Spring AOP
- Event publishment
ApplicationContext context = new ClassPathXmlApplicationContext("calsspath:bean.xml");
BeanClassName instance = (BeanClassName) context.getBean("idOfTheBean");
What we’re gonna discuss here?
We will discuss the following concepts with hands on practice in it, Please stay tuned for more updates and post your query and suggestions.
- Spring Setup
- Spring IOC and Dependency Injection
- Spring AOP
- Spring MVC
- Spring Securities
- Spring MVC With JDBC Template