SlideShare a Scribd company logo
An Survey of Spring Chris Roeder March, 2011 This talk summarizes a lot of what is available in: Spring In Action , Craig Walls, Manning 2008
Spring is a collection of frameworks: IoC – an “Inversion of Control”  AKA: Dependency Injection Framework Data Access,Transaction Management, Security
Remote Access Framework
Spring Dynamic Modules
Aspects – a way to deal with “cross cutting concerns”
MVC – an alternative to web application frameworks like Struts
Spring does not re-invent the wheel Uses existing logging frameworks
Uses existing  anything:  ORM, transactions, Aspects, Remoting, etc.
Spring is there to provide “portability” between  frameworks that share a purpose and interface
Spring Frameworks are Abstractions Frameworks are collections of Java interfaces
Implemented by a variety of solutions: Hibernate, JPA, Toplink “Injected” into your code by the config file using the Java Bean Interface (more)
Leaving your code simple and full of POJOs (more later)
When needs require a different implementation, very easy to change the config file with no code changes
Detail: Java Bean “A JavaBean is a Java Object that is serializable, has a nullary constructor, and allows access to properties using getter and setter methods.” http://en.wikipedia.org/wiki/JavaBean Not an  Entity  Java Bean or EJB
Detail: POJO “The name is used to emphasize that a given object is an ordinary Java Object, not a special object, and in particular not an Enterprise JavaBean” http://en.wikipedia.org/wiki/Plain_Old_Java_Object Meaning it's not tied to a particular framework.
Inversion of Control or Dependency Injection? Inversion of Control is a general concept that relates to event-driven programming where the stream of events dictates execution.
Dependency Injection is a more specific concept that refers to setting values on objects (Java Beans) from an external source.
Spring calls the framework IoC.

More Related Content

PDF
Introduction to Spring's Dependency Injection
PDF
Spring 2
PDF
Hibernate Interview Questions
PDF
Hibernate Interview Questions | Edureka
PDF
Spring Framework -I
PDF
Swiz DAO
PPSX
Struts 2 - Hibernate Integration
DOCX
Hibernate3 q&a
Introduction to Spring's Dependency Injection
Spring 2
Hibernate Interview Questions
Hibernate Interview Questions | Edureka
Spring Framework -I
Swiz DAO
Struts 2 - Hibernate Integration
Hibernate3 q&a

What's hot (19)

PPS
Java Hibernate Programming with Architecture Diagram and Example
PPTX
Spring & hibernate
DOC
24 collections framework interview questions
PPTX
Hibernate ppt
PPSX
Spring - Part 3 - AOP
PDF
Spring Framework - III
PPTX
Introduction to jQuery
PPT
ADO.NET Entity Framework
PPTX
Spring framework in depth
PPTX
Dependency Injection Inversion Of Control And Unity
PDF
Spring Framework-II
PDF
Struts An Open-source Architecture for Web Applications
DOC
Introduction To Corba
PPTX
Anypointconnectordevkit 160816041722
PPTX
EJB 3.0 course Sildes and matrial
PPTX
Spring jdbc dao
DOCX
TY.BSc.IT Java QB U6
ODT
Spring IOC advantages and developing spring application sample
PPTX
Struts & spring framework issues
Java Hibernate Programming with Architecture Diagram and Example
Spring & hibernate
24 collections framework interview questions
Hibernate ppt
Spring - Part 3 - AOP
Spring Framework - III
Introduction to jQuery
ADO.NET Entity Framework
Spring framework in depth
Dependency Injection Inversion Of Control And Unity
Spring Framework-II
Struts An Open-source Architecture for Web Applications
Introduction To Corba
Anypointconnectordevkit 160816041722
EJB 3.0 course Sildes and matrial
Spring jdbc dao
TY.BSc.IT Java QB U6
Spring IOC advantages and developing spring application sample
Struts & spring framework issues
Ad

Similar to Spring survey (20)

PPT
Spring Framework
PPT
Spring introduction
PPT
PDF
Spring Framework Tutorial | VirtualNuggets
PPTX
Spring
PPT
Spring ppt
ODT
Spring framework
DOCX
Spring notes
DOC
The Complete Spring Tutorial
PPT
Spring Framework
PPT
Spring - a framework written by developers
PPTX
Spring Framework Rohit
PPTX
Introduction to Spring Framework
 
PPTX
unit_1_spring_1.pptxfgfgggjffgggddddgggg
PPTX
Spring Basics
PPTX
Spring tutorials
PPTX
Spring framework Introduction
PDF
Spring presentecion isil
PDF
Spring presentecion isil
PPT
Tu1 1 5l
Spring Framework
Spring introduction
Spring Framework Tutorial | VirtualNuggets
Spring
Spring ppt
Spring framework
Spring notes
The Complete Spring Tutorial
Spring Framework
Spring - a framework written by developers
Spring Framework Rohit
Introduction to Spring Framework
 
unit_1_spring_1.pptxfgfgggjffgggddddgggg
Spring Basics
Spring tutorials
Spring framework Introduction
Spring presentecion isil
Spring presentecion isil
Tu1 1 5l
Ad

More from Chris Roeder (7)

PDF
Roeder posterismb2010
PPTX
Roeder rocky 2011_46
PPTX
PPTX
PPTX
Rocky2010 roeder full_textbiomedicalliteratureprocesing
PPTX
PPTX
Hibernate
Roeder posterismb2010
Roeder rocky 2011_46
Rocky2010 roeder full_textbiomedicalliteratureprocesing
Hibernate

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Modernizing your data center with Dell and AMD
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
A Presentation on Artificial Intelligence
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
Modernizing your data center with Dell and AMD
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Spring survey

  • 1. An Survey of Spring Chris Roeder March, 2011 This talk summarizes a lot of what is available in: Spring In Action , Craig Walls, Manning 2008
  • 2. Spring is a collection of frameworks: IoC – an “Inversion of Control” AKA: Dependency Injection Framework Data Access,Transaction Management, Security
  • 5. Aspects – a way to deal with “cross cutting concerns”
  • 6. MVC – an alternative to web application frameworks like Struts
  • 7. Spring does not re-invent the wheel Uses existing logging frameworks
  • 8. Uses existing anything: ORM, transactions, Aspects, Remoting, etc.
  • 9. Spring is there to provide “portability” between frameworks that share a purpose and interface
  • 10. Spring Frameworks are Abstractions Frameworks are collections of Java interfaces
  • 11. Implemented by a variety of solutions: Hibernate, JPA, Toplink “Injected” into your code by the config file using the Java Bean Interface (more)
  • 12. Leaving your code simple and full of POJOs (more later)
  • 13. When needs require a different implementation, very easy to change the config file with no code changes
  • 14. Detail: Java Bean “A JavaBean is a Java Object that is serializable, has a nullary constructor, and allows access to properties using getter and setter methods.” http://en.wikipedia.org/wiki/JavaBean Not an Entity Java Bean or EJB
  • 15. Detail: POJO “The name is used to emphasize that a given object is an ordinary Java Object, not a special object, and in particular not an Enterprise JavaBean” http://en.wikipedia.org/wiki/Plain_Old_Java_Object Meaning it's not tied to a particular framework.
  • 16. Inversion of Control or Dependency Injection? Inversion of Control is a general concept that relates to event-driven programming where the stream of events dictates execution.
  • 17. Dependency Injection is a more specific concept that refers to setting values on objects (Java Beans) from an external source.
  • 18. Spring calls the framework IoC.
  • 19. I call the concept used here DI.
  • 20. Detail: IoC Dependency Injection (DI) involves abstracting out the introduction of a project's components.
  • 21. Even with good modularity, you still hard-code them together with code like this:
  • 22. public static void main(String args[]) { DataProvider dp = new DataProvider(); CorpMetrics metrics = new CorpMetrics(); metrics.calculate(dp);
  • 23. Detail: IoC 2 In other situations, JDBC in EJB for example, collaborators aren't hard-coded, but find each other at runtime:
  • 24. A JDBC setup finds its database connection by consulting JNDI, making environmental assumptions: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle"); Connection conn = ds.getConnection(); ( http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html )
  • 25. Changes still involve changing the java code.
  • 26. Detail: IoC 3 Separate classes allows flexibility
  • 28. Unit Testing with different configurations is made easier.
  • 29. IoC is used as a supporting technology throughout Spring
  • 30. UIMA users, as described in a 2009 poster paper, would find this eerily familiar A bit of programmer humor would involve using uimaFIT and Spring to define a pipeline in a Spring config file instead of a CPE.
  • 31. Detail: IoC 4 Alternate implementations require interfaces:
  • 33. Create “new” implementations of Classes that implement them.
  • 34. Easy to swap with a different implementation when both implement the same Java interface.
  • 35. Also works to enable a kind of multiple inheritance in Java.
  • 36. Survey: Data Access POJO model entities can be stored in any ORM tool, just plain JDBC or others
  • 37. Operations on entities built in Data Access Objects (DAO) GetById(), GetListWhere(), Update(), etc. Spring provides “templates” to make building DAOs easy
  • 38. BTW, these are used in FLEX integration
  • 39. Survey: Transaction Management Abstracts on top of JDBC, Hibernate, JPA, JMS, EJB transaction.jta.* classes
  • 40. Databases handle their own transactions: START TRANSACTION, SAVE TRANSACTION EJB containers allow transactions between multiple systems
  • 41. Coding to Spring allows flexibility and growth
  • 42. Survey: Remote Access Compares to RMI, SOAP WS, Hessian, Burlap
  • 43. Abstracts the concept of remoting and provides different implementations.
  • 44. Client and service objects are POJOs.
  • 45. Can make use of JSR-181 Web Services Metadata annotations
  • 46. Survey: Dynamic Modules Spring-DM is an implementation and integration of OSGI modules into Spring.
  • 47. provide another layer of encapsulation over the concept of Class. Now you can have private and public classes as members of a module (jar).
  • 48. allow for a lifecycle, so module can have a “running” state.
  • 49. provide better naming, so versions can be included.
  • 50. provide restricted “class space”, allowing for more than one version of a class at the same time.
  • 51. More: Yuriy is working on this
  • 52. Survey: Aspects Cross-Cutting Concern: “functions that span multiple points of an application”
  • 54. Makes use of a proxy facility in Java reflection. Instead of creating and using a new object, you create the object and a proxy around it. Then use the proxy in it's place.
  • 55. The proxy intercepts function calls and allows implementations of a Handler interface to intercept them. Other Implementations exist, but are intrusive.
  • 56. Survey: MVC Spring has a Model, View, Control (MVC) framework for web applications. It separates code into three types: Model – the data and functions to manipulate it
  • 57. View – the JSP pages to render a web page
  • 58. Controller – the plumbing or routing A kind of “Model 2” architecture where a controller servlet controls creates beans and introduces them to JSPs Model 1 architecture is js JSP and Bean, leaving much to the JSP and scriptlets.