Created
July 29, 2021 04:50
-
-
Save JandenMa/7ae034f283d4be0452cb49ec66bf8946 to your computer and use it in GitHub Desktop.
Revisions
-
JandenMa created this gist
Jul 29, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ ### Definitions - Ioc: Inversion of control. - Inversion of Control is a principle in software engineering which transfers the control of objects or portions of a program to a container or framework. We most often use it in the context of object-oriented programming. - In contrast with traditional programming, in which our custom code makes calls to a library, IoC enables a framework to take control of the flow of a program and make calls to our custom code. To enable this, frameworks use abstractions with additional behavior built in. If we want to add our own behavior, we need to extend the classes of the framework or plugin our own classes. - The advantages of this architecture are: - decoupling the execution of a task from its implementation - making it easier to switch between different implementations - greater modularity of a program - greater ease in testing a program by isolating a component or mocking its dependencies, and allowing components to communicate through contracts - DI: Dependency Injection. - Dependency injection is a pattern we can use to implement IoC, where the control being inverted is setting an object's dependencies.