ioc containers: theory and practice
TRANSCRIPT
![Page 1: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/1.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Wednesday, May 3, 2023
IoC Containers: Theory and PracticeBoris Modylevsky
![Page 2: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/2.jpg)
Slide Header…
QualiSystems Proprietary & Confidential2
What is dependency?
![Page 3: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/3.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
• Code is tightly coupled
• Difficult to isolate when testing
• Difficult to maintain:
• If I change ComponentX how to I know what else will affect? Did I break anything?
What problems do dependencies create?
![Page 4: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/4.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
• The ability to supply (inject) an external dependency into a software component.
What is Dependency Injection?
![Page 5: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/5.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
•Constructor•Setter•Method
Types of Dependency Injection
![Page 6: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/6.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Constructor Injection
![Page 7: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/7.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Attribute Injection
![Page 8: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/8.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Method Injection
![Page 9: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/9.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
• Configuration (XML/JSON)
• Explicit
• Convention
• Auto wiring
Registration Types
![Page 10: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/10.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
IoC Containers in .NET
AutoFac fFastInjector Hiro Maestro Munq Speedioc TinyIo
c
Caliburn.Micro Funq IfInjector MEF Ninject Spring.NE
T Unity
Catel Grace LightCore MEF2 Petite Stiletto Wind
sor
DryIoc Griffin LightInject
MicroSliver QuickInject Structure
Map No
Dynamo HaveBox LinFu Mugen SimpleInjector
StyleMVVM Unity
![Page 11: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/11.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Popular IoC Containers
Unity Ninject AutoFac StructureMap Windsor0
0.5
1
1.5
2
2.5
3
3.5
Downloads in millions
Downloads in millions
![Page 12: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/12.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Demo
![Page 13: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/13.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Source: http://tinyurl.com/h7qntep by Nathanael Mann
Performance Comparison
![Page 14: IoC containers: Theory and Practice](https://reader034.vdocuments.site/reader034/viewer/2022042723/5879c99e1a28abb42a8b6e45/html5/thumbnails/14.jpg)
Slide Header…
QualiSystems Proprietary & Confidential
Visit our Website