This document provides an overview of Spring fundamentals including dependency injection, the Spring IoC container, bean configuration, bean scopes, the bean lifecycle, AOP with Spring, testing with Spring, and topics beyond the Spring basics. It discusses how Spring addresses common problems developers face through its features like dependency injection and aspects.
2. Agenda Why DI and SL vs DI. Dependency injection and The Spring IoC container Various approaches of Bean Configuration Bean scopes Bean Lifecycle AOP with Spring Spring AspectJ integration Testing with Spring Beyond Spring Basics
3. Building OO systems Its all about Objects Its all about Instantiating objects Its all about communicating between the objects Its all about collaborating objects Its all about managing objects Its all about extending objects Its all about monitoring objects
5. What developers end up Writing to much boilerplate Coding the same patterns again Duplications Managing infrastructure Entangled interfaces Complicated Dependencies
8. S.O.L.I.D The Single Responsibility Principle The Open Closed Principle The Liskov Substitution Principle The Interface Segregation Principle The Dependency Inversion Principle
14. DI Approaches Pre DI Construction by hand Factory Pattern Service Locator
15. DI Frameworks Hollywood principle Objects are handed to you New and Factories - Not your concern Well managed Beans First class Bean scope support No/less boilerplate Testability dependency Injector dependency Client
30. Graduate to AOP Enforce inheritance to achieve concern of separation? Specification like EJB have weird inheritance, your class never implement your interface ..huh Why not use POJOs and apply CCC on them thru runtime magic ?
32. AOP Lingo and Jargons Aspect – The CCC that can be modularized Advice – Functionality of an Aspect (logging) Jointpoint – Opportunities in program execution to apply advice Pointcut – Exact jointpoint where advice are weaved Weaving :linking objects with other applicatin objects
33. Spring AOP Supports only method join points Supports only load-time weaving Advise types Before Around After –returning After–throwing After – finally
36. Testing with Spring Support for Unit and integration testing Support JUnit 3.8.x/4.x and TestNG. Readymade mocks for most JEE dependencies like JNDI, Servlet API, etc Spring TestContextFramework Supports Fixture wiring transparently Support bean caching Transaction management Extensive spring-specific support
37. Beyond Spring basics Spring MVC Spring DAO Spring ORN Spring JEE (JMS/JCA/JMX/Remoting) Spring Web flow Spring ROO Spring Integration Spring Security