Spring framework

841 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
841
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Spring framework

  1. 1. Spring Framework Sean Melody November 2, 2011
  2. 2. Introduction – Spring training?
  3. 3. What is the Spring Framework? <ul><li>Originally created by Rod Johnson as an alternative to J2EE / EJB
  4. 4. Interface21 / Springsource now owned by VMWare
  5. 5. Apache 2.0 Licensed
  6. 6. Rich ecosystem of tools, frameworks and patterns
  7. 7. Widely adopted in Java community
  8. 8. Strong forum and large knowledge base on Stackoverflow.com </li></ul>
  9. 9. Life before Spring
  10. 10. The Spring Ecosystem <ul><li>Spring – core
  11. 11. Security
  12. 12. Web / MVC
  13. 13. Aspect Oriented Programming (AOP)
  14. 14. Transaction Management
  15. 15. Springsource Tool Suite
  16. 16. Spring social </li></ul><ul><li>Remoting
  17. 17. Testing
  18. 18. Integration (EIP)
  19. 19. Batch processing
  20. 20. Messaging
  21. 21. Spring Roo
  22. 22. tcServer </li></ul>
  23. 23. Core Principles <ul><li>Inversion of Control </li><ul><li>Dependency Injection </li></ul><li>Standards compliance a secondary goal
  24. 24. Test first
  25. 25. Avoid coupling to Spring framework
  26. 26. Cross cutting concerns through simplified AOP
  27. 27. Convention over Configuration </li></ul>
  28. 28. Examples We're using Spring in SLI every day! Here's how: API Security, IoC container, Test Ingestion IoC container, Test DAL Spring Data, IoC Container, Test Databrowser Spring MVC, IoC, Test
  29. 29. Inversion of Control (IoC) <ul>Component scanning <ul><li>Bean stereotypes
  30. 30. Auto-wiring </li></ul><li>ApplicationContextAware
  31. 31. @PostConstruct </li></ul><ul>Java: @Service public class SchoolRepositoryService implements SchoolService { @Autowired SchoolRepository schoolRepository; </ul><ul>XML: <li><context:component-scan base-package=&quot;net.wgen&quot; />
  32. 32. <context:annotation-config /> </li></ul>
  33. 33. Spring Data <ul><li>Repository pattern in the DAL abstracts implementation of OR/M from service and ingestion layers
  34. 34. Allows for swap-out of persistence technology if needed
  35. 35. Eliminates boilerplate code that exists in many JPA / Hibernate projects by proxying DAOs. </li></ul><ul>db.xml: <jpa:repositories base-package=&quot;net.wgen.sli.repository&quot; /> </ul>
  36. 36. Security <ul><li>API module has in-memory authentication example in securityContext.xml
  37. 37. Leverages the security namespace
  38. 38. More usage of Spring Security's permission evaluation coming in Sprint 3 </li></ul>
  39. 39. Spring FAQ <ul><li>Q: Can Spring help me decouple infrastructure concerns from my business logic? </li><ul><li>A: Yes, that's the core use case around using the IoC container </li></ul><li>Q: Can Spring help me eliminate repetitive code? </li><ul><li>A: Runtime proxying, dependency injection, and AOP are solutions </li></ul><li>Q: Can Spring help me isolate layers during unit test time? </li><ul><li>A: Yes, use different application contexts that mock out external dependencies </li></ul><li>Q: Can Spring help me with my Christmas shopping or cooking my potluck dish? </li><ul><li>A: No, sorry. </li></ul></ul>
  40. 40. References <ul><li>http://www.martinfowler.com/articles/injection.html
  41. 41. http://www.springsource.org/ </li></ul>

×