Spring framework & inversion of control

509 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
509
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Spring framework & inversion of control

  1. 1. Spring Framework & Inversion of Control By Nazim Sitmanbetov
  2. 2. Preconditions  Keep calm  Sit back  Relax
  3. 3. Inversion of Control  OOP principle, not design pattern  One of
  4. 4. Principle in OOP  Modules depend on abstractions  Low level modules do not depend on high level modules
  5. 5. Modules depend on abstractions Bad Good
  6. 6. Low level modules do not depend on high level modules Bad Tip: Avoid cyclic dependencies Good
  7. 7. IoC implementations  Factory Method  Service Locator  Dependency Injection (DI)
  8. 8. Factory Method
  9. 9. Service Locator
  10. 10. Dependency Injection  Allow client of module to set dependency Module Client
  11. 11. Achievement unlocked
  12. 12. Framework  Java  Light-weight  Open Source
  13. 13. What means Light-Weight?  No container requirements  Quick start  Application easy-to-test
  14. 14. Spring & IoC  Dependency Injection  Service Locator
  15. 15. Spring & Dependency Injection XML Based Configuration mcdonalds-with-kazatin.xml Java Program
  16. 16. Spring & Service Locator Annotation Based mcdonalds-locator.xml
  17. 17. Spring & Service Locator
  18. 18. Dependency Injection vs Service Locator DI Service Locator • Imperative • Can be used with existing classes • Declarative • Need to modify existing classes
  19. 19. Spring components
  20. 20. Time to cook

×