You are on page 1of 25

Spring Framework Overview & Tools

Sang Shin www.javapassion.com Learning is fun!

Topics

What is Spring framework? Why Spring framework? Spring framework architecture Usage scenario Tools (we are going to use in this course)

What is Spring Framework?


3

What is Spring Framework?

Light-weight yet comprehensive framework for building Java applications


Web applications Enterprise applications Desktop applications Batch application Integration/SOA application

Key Features - DI

JavaBeans-based configuration management, applying Inversion-of-Control principles, specifically using the Dependency Injection (DI) technique

This aims to eliminate manual wiring of components Spring MVC uses it internally

A core bean factory, which is usable globally

Key Features - Persistence

Generic abstraction layer for database transaction management Higher abstraction over JDBC Integration with persistence frameworks such as Hibernate, JPA

Key Features - Web-Tier

Spring MVC web application framework, built on core Spring functionality, supporting many technologies for generating views, including JSP, Facelets, FreeMarker, Velocity, Tiles, iText, and POI(Java API to Access Microsoft Format files). Spring Web Flow - fine-grained navigation

Key Features - AOP

Extensive aspect-oriented programming (AOP) framework for providing services such as transaction management, security support

As with the Inversion-of-Control parts of the system, this aims to improve the modularity of systems created using the framework.

Why Use Spring Framework?


9

Why Use Spring?

Wiring components (JavaBeans) through Dependency Injection

Promotes de-coupling among the parts that make up an application Insulates a user of a functionality from implementation details POJO classes can be tested without being tied up with the framework
10

Design to interfaces

Test-Driven Development (TDD)

Why Use Spring? (Continued)

Declarative programming through AOP

Easily configured aspects, esp. transaction support Abstractions insulate application from specifics, eliminate redundant code Underlying technology specifics still accessible Handle common error conditions

Simplify use of popular technologies


11

Why Use Spring? (Continued)

Conversion of checked exceptions to unchecked

(Or is this a reason not to use it?) Extremely modular and flexible Easy to extend Many reusable classes

Not an all-or-nothing solution

Well designed

12

Why Use Spring? (Continued)

Integration with other technologies


EJB (for Java EE applications) JPA, Hibernate, iBates, JDBC (for data access) Velocity, etc. (for presentation) JSF, Wicket, Struts, etc (For web)

13

Spring Framework Architecture


14

Spring Framework Architecture

15

Usage Scenarios
16

Usage Scenarios

You can use Spring in all sorts of scenarios, from applets up to fully-fledged enterprise applications using Spring's transaction management functionality and web framework integration

17

Typical Full-fledged Spring Web Application

18

Spring Middle-tier Using 3 party Web Framework

rd

19

Remoting Usage Scenario

20

Tools
21

SpringSource Tool Suite (STS)

Eclipse-powered development environment for building Spring-powered enterprise applications

Supports Java, Spring, Groovy and Grails

Comes with developer edition of vFabric tc Server

vFabric tc Server is Tomcat that is optimized for Spring

22

Eclipse and Tomcat

You can use Eclipse and Tomcat for building and deploying Spring application You have to install m2eclipse Maven plug-in's to Eclipse IDE yourself

Core and WTP m2eclipse plug-in's

You have to install and configure Tomcat to Eclipse IDE yourself

23

JRebel

JVM plug-in that detects any change in Spring application Java, annotations, configuration files and make the changes instantly visible Commercial product You can get 3-month free license from

http://www.javapassion.com/getjrebel

Usage of JRebel is optional for this course but is recommended

24

Thank you!

Check JavaPassion.com Codecamps! http://www.javapassion.com/codecamps Learn with Passion!

25 31

You might also like