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

Spring Core

This document provides an overview of the Spring framework. It discusses that Spring is an open-source framework that aims to make enterprise application development easier through features like inversion of control and dependency injection. It allows for loose coupling through its lightweight container that manages components and dependencies. The document outlines some of Spring's key benefits like easy development, scalability, and testability. It then covers Spring concepts like POJOs, beans, dependency injection, and bean scopes.

Uploaded by

Do Minh Toan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Spring Core

This document provides an overview of the Spring framework. It discusses that Spring is an open-source framework that aims to make enterprise application development easier through features like inversion of control and dependency injection. It allows for loose coupling through its lightweight container that manages components and dependencies. The document outlines some of Spring's key benefits like easy development, scalability, and testability. It then covers Spring concepts like POJOs, beans, dependency injection, and bean scopes.

Uploaded by

Do Minh Toan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

SPRING

present by toan.do

Agenda
. What spring
. Why spring
. IoC/DI

What Is Spring
This is a open-source framework
Created by Rod Johnson
Complexity of enterprise application development

pring is a lightweight inversion of control and aspect oriented container framewo

What is Spring
Lightweight
. Size and overhead

Inversion of control
. Container
. Loose coupling

Aspect-oriented programing
. Cohesive development

Why is spring
Easy development
Business focus
Complexity
Scalability
Maintainability
Testability
http://www.tutorialspoint.com/spring/spring_overview.htm
http://www.wrox.com/WileyCDA/Section/Why-Use-the-Spring-Framework-.id130098.html

Inversion of control/Dependency
injection
. Dependency inversion principle
. Inversion of control
. Dependency injection
http://www.codeproject.com/Articles/615139/An-Absolute-Beginners-Tutorial-onDependency-Inver
http://www.codeproject.com/Articles/542752/Dependency-Inversion-Principle-IoCContainer-Depen
http://www.dotnet-tricks.com/Tutorial/dependencyinjection/bSVa100413-UnderstandingInversion-of-Control,-Dependency-Injection-and-Service-Locator.html
http://martinfowler.com/articles/injection.html

Spring Overview

Spring Container
Ioc
Container

POJO
Bean
BeanFactory

POJO class
Ordinary Java Object
Dont extent prespecified classes
Dont implement prespecified interfaces
Purely focus on business logic, dependencies on
framework

Bean
An Object
Managed by container

BeanFactory
Manage Bean
XmlBeanFactory

Bean Lifecycle

Bean Definition
<bean id="goodByeService" class="com.toando.GoodByeService">

. Name
. Class
. Alias
. Properties
. init-method
. destroy-method
. scope
. inheritance
. primary
. factory-method
. factory-bean

Bean Scope
. singleton
. prototype
. request
. session
. global-session
. bundle
(http://docs.spring.io/osgi/docs/current/reference/html/)

Bean Injection
. Constructor Injection
. Setter Injection
. Method Injection
injection.jsp)

(http://www.studytrails.com/frameworks/spring/spring-method-

Bean Inheritance
. abstract
. parent

Factory Bean/Factory Method


. factory-bean
. factory-method

Autowire
. no
. byName
. byType
. constructor

Application Context
. Extend BeanFactory
. Add more function for application
. AOPs features
. Message Resource
. Event publication
. FileSystemXmlApplicationContext
. ClassPathXmlApplicationContext
. WebXmlApplicationContext

Annotation Based Configuration


. @Required
. @Autowired
. @Qualifier

. @Component
. @Service
. @Repository

Java Annotation Configuration


. What annotation
. @Configuration
. @Bean

Next Topics
. Spring AOP
. Spring MVC
. Spring Data
. Spring Projects

You might also like