Wednesday, October 28, 2020

Inversion of Control (IOC), Dependency Injection (DI) Oversimplified

Introduction

IOC and DI are very useful patterns that are used in almost every production project. But, for me personally, they are pretty misleading and difficult concepts to understand. Here, I'll example what both of them are and implement a simplified proof of concept. 

Inversion of Control

Inversion of control is a pattern responsible for your class initialization. They will be created and set on startup or before each class is initialized. So initialization is not done in constructor but by classes themselves (control is inverted). In a configuration class, you can what implementation each interface will be used. 



from DZone.com Feed https://ift.tt/3jAkf45

No comments:

Post a Comment