software so that it's easier to scale and maintain. • S -ingle responsibility A class should have a single responsibility • O-pen-Closed Classes should be open for extension, but closed for modification • L-iskov substitiution Objects of parent Class or its child Class can be used in the same way without any errors. • I-nterface segregation Clients should not be forced to depend on methods that they do not use. • D -ependency Inversion High-level modules should not depend on low-level modules but depend on abstraction.
one object (or static method) supplies the dependencies of another object , instead of having it constructs them itself. Its responsible for: 1. Creating the objects 2. Knowing which classes require those objects 3. And provide them all those objects
Boiler plate code is reduced, as initializing of dependencies is done by the injector component. • Extending the application becomes easier. • Helps to enable loose coupling between classes and its dependencies.
objects and functions, which can be used to inject dependencies. • uses a runtime approach to generate boilerplate code for dependency injection KOIN • Jetpack recommended library • Removes boilerplate code via annotations. -generates code based on annotations which can be used to inject dependencies. • uses a compile-time approach to generate boilerplate code for dependency injection.