The Spring Framework: an Open Source Java Platform for Developing Robust Java Applications

The Spring Framework: an Open Source Java Platform for Developing Robust Java Applications

International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-3075, Volume-3 Issue-2, July 2013 The Spring Framework: An Open Source Java Platform for Developing Robust Java Applications Dashrath Mane, Ketaki Chitnis, Namrata Ojha Abstract— The fundamental concepts of Spring Framework is Supported deployment platforms range from standalone presented in this paper.Spring framework is an open source Java applications to Tomcat and Java EE servers such as platform that provides comprehensive infrastructure support for WebSphere. Spring is also a first-class citizen on major developing robust Java applications very easily and very rapidly. cloud platforms with Java support, e.g. on Heroku, Google The Spring Framework is a lightweight solution and a potential App Engine, Amazon Elastic Beanstalk and VMware's one-stop-shop for building your enterprise-ready applications. Cloud Foundry.[1] IndexTerms— Aspect Oriented Programming, Dependency Injection, IoC Container, ORM. II. SPRING FRAMEWORK ARCHITECTURE Spring could potentially be a one-stop shop for all your I. INTRODUCTION enterprise applications; however, Spring is modular, Spring is the most popular application development allowing you to pick and choose which modules are framework for enterprise Java. Millions of developers applicable to you, without having to bring in the rest. around the world use Spring Framework to create high The Spring Framework provides about 20 modules which performing, easily testable, reusable code. Spring can be used based on an application requirement. framework is an open source Java platform and it was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003. Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB.The core features of the Spring Framework can be used in developing any Java application, but there are extensions for building web applications on top of the Java EE platform. Spring framework targets to make J2EE development easier to use and promote good programming practice by enabling a POJO-based programming model. The Spring Framework provides a comprehensive programming and configuration model for modern Java - based enterprise applications - on any kind of deployment Fig. 1. Spring Framework Architecture platform. A key element of Spring is infrastructural support A. Core Container at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on The Core Container consists of the Core, Beans, Context, application-level business logic, without unnecessary ties to and Expression Language modules whose detail is as specific deployment environments. Spring includes: follows: Flexible dependency injection with XML annotation- The Core module provides the fundamental parts of the based configuration styles framework, including the IoC and Dependency Injection features. Advanced support for aspect-oriented programming with proxy-based and AspectJ-based variants. The Bean module provides BeanFactory which is a sophisticated implementation of the factory pattern. First-class support for common open source frameworks such as Hibernate and Quartz The Context module builds on the solid base provided by the Core and Beans modules and it is a medium to A flexible web framework for building RESTful MVC access any objects defined and configured. The applications and service endpoints ApplicationContext interface is the focal point of the Spring is modular in design, allowing for incremental Context module. adoption of individual parts such as the core container or the JDBC support. While all Spring services are a perfect fit for The Expression Language module provides a powerful the Spring core container, many services can also be used in expression language for querying and manipulating an a programmatic fashion outside of the container. object graph at runtime. B. Data Access/Integration The Data Access/Integration layer consists of the JDBC, ORM, OXM, JMS and Transaction modules whose detail is Manuscript Received July, 2013. as follows: Mr Dashrath Mane, Assistant Professor, Department of MCA, V.E.S. The JDBC module provides a JDBC-abstraction layer Institute of Technology, Mumbai, India. that removes the need to do Miss NamrataOjha, Final Year MCA Student, V.E.S. Institute of Technology, Mumbai, India. tedious JDBC related Miss KetakiChitnis, Final Year MCA Student, V.E.S. Institute of coding. Technology, Mumbai, India. Published By: Retrieval Number: B1010073213 /2013©BEIESP Blue Eyes Intelligence Engineering 137 & Sciences Publication The Spring Framework: An Open Source Java Platform for Developing Robust Java Applications The ORM module provides integration layers for popular object-relational mapping APIs, including JPA, JDO, Hibernate, and iBatis. The OXM module provides an abstraction layer that supports Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX and XStream. The Java Messaging Service JMS module contains features for producing and consuming messages. The Transaction module supports programmatic and declarative transaction management for classes that implement special interfaces and for all your POJOs. Fig. 2. Spring IoC Container C. Web The Web layer consists of the Web, Web-Servlet, Web- Spring provides following two distinct types of containers. Struts, and Web-Portlet modules whose detail is as follows: The Web module provides basic web-oriented A. Spring BeanFactory Container integration features such as multipart file-upload This is the simplest container providing basic support for functionality and the initialization of the IoC container DI. The BeanFactory and related interfaces, such as using servlet listeners and a web-oriented application BeanFactoryAware, InitializingBean, DisposableBean, are context. still present in Spring for the purposes of backward The Web-Servlet module contains Spring's model-view- compatibility with the large number of third-party controller (MVC) implementation for web applications. frameworks that integrate with Spring. The Web-Struts module contains the support classes for B. Spring ApplicationContext Container integrating a classic Struts web tier within a Spring application. This container adds more enterprise-specific functionality such as the ability to resolve textual messages from a D. Miscellaneous: properties file and the ability to publish application events to The AOP module provides aspect-oriented interested event listeners. This container is defined by programming implementation allowing you to define the org.springframework.context.ApplicationContextinterfac method-interceptors and point cuts to cleanly decouple e. code that implements functionality that should be The ApplicationContext container includes all separated. functionality of the BeanFactory container, so it is generally The Aspects module provides integration with AspectJ recommended over the BeanFactory. BeanFactory can still which is again a powerful and mature aspect oriented be used for light weight applications like mobile devices or programming (AOP) framework. applet based applications where data volume and speed is The Instrumentation module provides class significant. instrumentation support and class loader C. Beans implementations to be used in certain application The objects that form the backbone of your application and servers. that are managed by the Spring IoC container are called The Test module supports the testing of Spring beans. A bean is an object that is instantiated, assembled, components with JUnit or TestNG frameworks. and otherwise managed by a Spring IoC container. These beans are created with the configuration metadata that you III. SPRING IOC CONTAINER supply to the container, for example, in the form of XML The Spring container is at the core of the Spring <bean/> definitions. Framework. The container will create the objects, wire them together, configure them, and manage their complete D.Spring Configuration Metadata lifecycle from creation till destruction. The Spring container Spring IoC container is totally decoupled from the format in uses dependency injection (DI) to manage the components which this configuration metadata is actually written. There that make up an application. These objects are called Spring are following three important methods to provide Beans which we will discuss in next chapter. configuration metadata to the Spring Container: The container gets its instructions on what objects to XML based configuration file. instantiate, configure, and assemble by reading Annotation-based configuration configuration metadata provided. The configuration Java-based configuration metadata can be represented either by XML, Java annotations, or Java code. The following diagram is a high- IV. DEPENDENCY INJECTION (DI) level view of how Spring works. The Spring IoC container The technology that Spring is most identified with is the makes use of Java POJO classes and configuration metadata Dependency Injection (DI) flavour of Inversion of Control. to produce a fully configured and executable system or The Inversion of Control (IoC) is a general concept, and it application. can be expressed in many different ways and Dependency Injection is merely one concrete example of Inversion of Control. When writing a complex Java application, application classes should be as independent as Published By: Retrieval Number: B1010073213 /2013©BEIESP Blue Eyes Intelligence

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us