Spring Core
Spring Core
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
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
Autowire
. no
. byName
. byType
. constructor
Application Context
. Extend BeanFactory
. Add more function for application
. AOPs features
. Message Resource
. Event publication
. FileSystemXmlApplicationContext
. ClassPathXmlApplicationContext
. WebXmlApplicationContext
. @Component
. @Service
. @Repository
Next Topics
. Spring AOP
. Spring MVC
. Spring Data
. Spring Projects