0% found this document useful (0 votes)
109 views

Spring UNIT V

The document provides an overview of the Spring Framework. It discusses how Spring addresses complications with earlier technologies like EJBs. It describes Spring's main features including the IOC container, data access framework, Spring MVC, transaction management, web services, JDBC abstraction, and testing framework. The architecture of Spring is also summarized, noting it consists of seven main modules.

Uploaded by

Shamanth Edge
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views

Spring UNIT V

The document provides an overview of the Spring Framework. It discusses how Spring addresses complications with earlier technologies like EJBs. It describes Spring's main features including the IOC container, data access framework, Spring MVC, transaction management, web services, JDBC abstraction, and testing framework. The architecture of Spring is also summarized, noting it consists of seven main modules.

Uploaded by

Shamanth Edge
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Spring Framework

RAGHAVENDRA RAO R V
2

Must be familiar with Core Competent enough to


Java Concepts apply J2EE Technologies

Before Spring class


begins

Introduction Spring Framework


3

Jdk 1.8 or higher

Eclipse Indigo or Higher


Spring Implementation
Well versed with Eclipse
Environment

Spring jar files

Spring Deployment
4
Introduction(1)

 Prior to the advent of Enterprise Java Beans (EJB), Java developers needed to use JavaBeans
to create Web applications
 Although JavaBeans helped in the development of user interface (UI) components, they were
not able to provide services, such as transaction management and security, which were
required for developing robust and secure enterprise applications
 The advent of EJB was seen as a solution to this problem EJB extends the Java components,
such as Web and enterprise components, and provides services that help in enterprise
application development
 Developing an enterprise application with EJB was not easy, as the developer needed to
perform various tasks, such as creating Home and Remote interfaces and implementing
lifecycle callback methods which lead to the complexity of providing code for EJBs Due to this
complication, developers started looking for an easier way to develop enterprise applications.
5
Introduction(2)

 Spring framework has emerged as a solution to all complications


 Spring framework uses various new techniques such as
 Aspect-Oriented Programming (AOP)
 Plain Old Java Object (POJO)
 dependency injection (DI)

 Spring is an open source lightweight framework that allows Java EE 7 developers to build simple, reliable, and scalable enterprise applications
 This framework mainly focuses on providing various ways to help you manage your business objects. It made the development of Web applications
much easier as compared to classic Java frameworks and Application Programming Interfaces (APIs), such as Java database connectivity(JDBC),
JavaServer Pages(JSP), and Java Servlet
 The Spring framework can be considered as a collection of sub-frameworks, also called layers,
 Spring AOP.
 Spring Object-Relational Mapping (Spring ORM).
 Spring Web Flow,
 Spring Web MVC.
6
IOC Container

Data Access Framework

Spring MVC Framework


Spring Framework
Features
Spring webservice

Transaction Management

JDBC Abstraction Layer

Spring TestContext
Framework
7
Introduction to Features : IoC container

 Refers to the core container that uses the DI or IoC pattern to implicitly provide an object
reference in a class during runtime
 This pattern acts as an alternative to the service locator pattern
 The IoC container contains assembler code that handles the configuration management of
application objects
 The Spring framework provides two packages, namely org.springframework.beans and
org.springframework.context which helps in providing the functionality of the IoC container
8
Introduction to Features : Data access Framework

 Allows the developers to use persistence APIs, such as JDBC and Hibernate, for storing
persistence data in database
 It helps in solving various problems of the developer
 How to interact with a database connection
 How to make sure that the connection is closed
 How to deal with exceptions
 How to implement transaction management
 It also enables the developers to easily write code to access the persistence data
throughout the application
9
Introduction to Features : Spring MVC framework

 Allows you to build Web applications based on MVC architecture


 All the requests made by a user first go through the controller and are then dispatched to
different views, that is, to different JSP pages or Servlets
 The form handling and form validating features of the Spring MVC framework can be
easily integrated with all popular view technologies such as ISP, Jasper Report,
FreeMarker, and Velocity
10
Introduction to Features : Transaction management

 Helps in handling transaction management of an application without affecting its code


 This framework provides Java Transaction API (JTA) for global transactions managed by
an application server and local transactions managed by using the JDBC Hibernate, Java
Data Objects (JDO), or other data access APIs
 It enables the developer to model a wide range of transactions on the basis of Spring’s
declarative and programmatic transaction management
11
Introduction to Features : Spring Web Service

 Generates Web service endpoints and definitions based on Java classes, but it is difficult
to manage them in an application
 To solve this problem, Spring Web Service provides layered-based approaches that are
separately managed by Extensible Markup Language (XML) parsing (the technique of
reading and manipulating XML)
 Spring provides effective mapping for transmitting incoming XML message request to an
object and the developer to easily distribute XML message (object) between two
machines
12
Introduction to Features : JDBC abstraction layer

 Helps the users in handling errors in an easy and efficient manner


 The JDBC programming code can be reduced when this abstraction layer is implemented
in a Web application
 This layer handles exceptions such as DriverNotFound
 All SQLExceptions are translated into the DataAccessException class. Spring’s data access
exception is not JDBC specific and hence Data Access Objects (DAO) are not bound to
JDBC only
13
Introduction to Features : Spring TestContext framework

 Provides facilities of unit and integration testing for the Spring applications
 Spring TestContext framework provides specific integration testing functionalities
 Context management
 Caching DI of test fixtures
 Transactional test management with default rollback semantics
14
Spring Framework Architecture

 The Spring framework consists of seven


modules
 Spring Core
 Spring AOP
 Spring Web MVC
 Spring DAO
 Spring ORM
 Spring context
 Spring Web flow

You might also like