Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
IoC Container
이규원(gyuwon@live.com)
https://www.facebook.com/gyuwon.yi
http://justhackem.wordpress.com/
Contents
• IoC
• IoC Container
• Test
• Demo
IOC
IoC
IoC
• Inversion of Control
Library
User Code LibraryLibrary Library
Framework
Framework User CodeUser Code User Code
IoC Container
Services
Component Service
Loose Coupling
Component Service
IService
Reusability
Testability
Dependency Injection
Component
Service
Injector
IService
<<create>>
Service Locator
Component
Service
Locator
IService
<<create>>
Dependency Inversion
Low-Level PackageHigh-Level Package
Component Service
IService
IService
Test
Software Testing
• Automate,
• automate,
• automate,
• and
• automate!
TDD(Test-Driven Development)
Write a test
Fails
Write
production code
Succeeds
Clean up
DDD(Domain-Driven Design)
• f : x -> y
• DDD : Domain -> Software
BDD(Behavior-Driven Development)
Write a
specification
Fails
Write
production code
Succeeds
Clean up
Domain
Testability
Test
Component Service
IService
Fragile or Non-testable
Test Double
IService
IoC Container
I’m testable!
Demo
Contact Manager
Architecture
Contact Manager Service
ASP.NET Web API
OWIN Self Host
Entity Framework
SQL Server
Get Action Method Unit Tests - 1
• Specification?
Repository Pattern
• IRepository
Get Action Method Unit Tests - 2
• Moq
• Fluent Assertions
Dependency Injection
• Ninject
Post Action Method Unit Tests
• Add
• SaveChanges
• Exception Expected
Introduction to IoC Container
Introduction to IoC Container
Introduction to IoC Container
Upcoming SlideShare
Loading in …5
×

Introduction to IoC Container

2,703 views

Published on

IoC 컨테이너에 대한 소개입니다.

데모 소스코드는 여기에 있습니다.
https://github.com/gyuwon/DotNetPractice/tree/master/IoC

Published in: Technology
  • Be the first to comment

Introduction to IoC Container

  1. 1. IoC Container 이규원(gyuwon@live.com) https://www.facebook.com/gyuwon.yi http://justhackem.wordpress.com/
  2. 2. Contents • IoC • IoC Container • Test • Demo
  3. 3. IOC
  4. 4. IoC
  5. 5. IoC • Inversion of Control
  6. 6. Library User Code LibraryLibrary Library
  7. 7. Framework Framework User CodeUser Code User Code
  8. 8. IoC Container
  9. 9. Services Component Service
  10. 10. Loose Coupling Component Service IService Reusability Testability
  11. 11. Dependency Injection Component Service Injector IService <<create>>
  12. 12. Service Locator Component Service Locator IService <<create>>
  13. 13. Dependency Inversion Low-Level PackageHigh-Level Package Component Service IService IService
  14. 14. Test
  15. 15. Software Testing • Automate, • automate, • automate, • and • automate!
  16. 16. TDD(Test-Driven Development) Write a test Fails Write production code Succeeds Clean up
  17. 17. DDD(Domain-Driven Design) • f : x -> y • DDD : Domain -> Software
  18. 18. BDD(Behavior-Driven Development) Write a specification Fails Write production code Succeeds Clean up Domain
  19. 19. Testability Test Component Service IService Fragile or Non-testable Test Double IService IoC Container I’m testable!
  20. 20. Demo Contact Manager
  21. 21. Architecture Contact Manager Service ASP.NET Web API OWIN Self Host Entity Framework SQL Server
  22. 22. Get Action Method Unit Tests - 1 • Specification?
  23. 23. Repository Pattern • IRepository
  24. 24. Get Action Method Unit Tests - 2 • Moq • Fluent Assertions
  25. 25. Dependency Injection • Ninject
  26. 26. Post Action Method Unit Tests • Add • SaveChanges • Exception Expected

×