the spring framework
TRANSCRIPT
The Spring Framework @maxgoff
BIG SMART DATA
The Spring Framework:
BIG SMART DATA
⁻ What is Spring ⁻ Modules ⁻ Spring MVC
What is Spring?
Comprehensive Programming/Config model Modern Java-based (JVM) Enterprise Focus: Lightweight & “Plumbing” Flexible Dependency Injection Infrastructure (support) for declarative:
transactions caching validation formatting
BIG SMART DATA
Spring Origin: Rod Johnson (Expert One-on-One J2EE Design and Development)
What is Spring?
Powerful abstractions: JDBC, JPA, JTA, JMS
Support for open source frameworks: Hibernate, Quartz
Flexible Web Framework for RESTful MVC Rich testing facilities
BIG SMART DATA
⁻ Modular in design ⁻ Incremental adoption ⁻ Range of deployment
platforms, such as Tomcat & WebSphere
⁻ Citizen of major clouds such as Heroku, VMware, & Amazon
What is Spring?
BIG SMART DATA
• Dependency Injection • Aspect-oriented programming • Data access framework • Transaction management framework • Remote access framework • Convention-over-configuration • Model-view-controller framework
BIG SMART DATA
Spring Modules
• Inversion of control container • Uses Java Reflection • Creates managed objects (“beans”) • Dependency Lookup • Dependency Injection Patterns: • Constructors • Properties • Factories
BIG SMART DATA
Dependency Injection
Spring Modules
BIG SMART DATA
Dependency Injection
Spring Modules
The Spring Container
Fully configured
system
Configuration Metadata
Your Business Objects (POJOs)
produces
• AOP: • increases modularity • allows for separation of cross- cutting concerns
BIG SMART DATA
Aspect-oriented framework
Spring Modules
• Resource management • Exception handling • Transaction participation • Resource unwrapping • Abstraction
BIG SMART DATA
Data access framework
Spring Modules
• Spring brings transaction abstractions:
• global, local, nested
• Platform TransactionManager
• Transaction Template
• metadata or Java annotations
BIG SMART DATA
Transaction management framework
Spring Modules
• Abstraction for various RPC technologies
BIG SMART DATA
Remote access framework
Spring Modules
Convention-over-configuration • Spring Roo
(http://www.springsource.org/spring-roo)
• Request-based framework • Strategy interfaces • GOAL: Simple and clear
BIG SMART DATA
MVC Framework Spring Modules
• Front Controller: DispatcherServlet Class
BIG SMART DATA
MVC Framework Spring Modules
• Clear separation of roles: Each role (controller, validator, command object, DispatcherServlet, etc) can be fulfilled by a specialized object
• Configuration of both framework and application classes as JavaBeans:
BIG SMART DATA
MVC Framework Spring Modules
• Adaptability & flexibility: Define any controller method signature you need, possibly using one of the parameter annotations
• Reusable business code: Use existing business objects as command or form objects instead of mirroring them to extend a particular framework base class
BIG SMART DATA
MVC Framework Spring Modules
• Customizable binding & validation • Customizable handler mapping & view resolution • Flexible model transfer:
Model transfer with a name/value Map supports easy integration with any view technology
• Customizable locale and theme resolution • Support for JSPs with/without Spring tag library
BIG SMART DATA
MVC Framework Spring Modules
• Support for JSTL • Support for Velocity without the need for
extra bridges • Spring tag library for data binding & themes • JSP form tag library
BIG SMART DATA
MVC Framework Spring Modules
Spring Resources Tutorials:
Developing a Spring Framework MVC application: http://static.springsource.org/docs/Spring-MVC-step-by-step/
Introduction to Spring Web MVC:
https://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
Resources: The Spring Framework:
http://www.springsource.org/spring-framework Modern Web:
http://www.springsource.org/features/modern-web NetBeans IDE:
http://netbeans.org
BIG SMART DATA
http://about.me/maxgoff http://linkedin.com/in/maxgoff
http://bigsmartdata.com @maxgoff
BIG SMART DATA