Tag Archives: solid-principles

Dependency Injection – Interface Injection

What is Interface Injection? »    Also known as Method injection. »    In this case Dependency declared inside the dependent class in the form of interface. »    So any class that implements that interface can be substituted into dependent class. »    Dependency is injected as the parameter of method. »    Useful where the whole class does… Read More »

Dependency Injection (DI)

According to Wikipedia “Dependency injection is a software design pattern that implements Inversion of Control (IoC) and allows a program design to follow the dependency inversion principle (DIP).”  »    Dependency Injection (DI) is a design pattern that demonstrates how to create loosely coupled classes. »    It implements Inversion of Control (IoC) in our program i.e. Dependency Injection (DI) supply the dependencies… Read More »

Inversion of Control (IoC)

According to Wikipedia “Inversion of Control (IoC) is an abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to procedural programming” We can simplify it as follows: »    IoC is a programming style where a framework or runtime controls the program… Read More »

Dependency Inversion Principle

According to Uncle Bob Martin: A. “High-level modules should not depend on low-level modules. Both should depend on abstractions.” B. “Abstractions should not depend on details. Details should depend on abstractions.” So we can easily explain it as follows: »    The Dependency Inversion principle (DIP) decouples lower level objects from higher level objects. »    To… Read More »

Gentle Introduction of Dependency

What is Dependency? In programming dependency is the relationship between »    One class with another class or interface, »    One module with another module, »    One method with another method »    One method with another class or interface and so forth.  Consider following scenario: »    Whenever a class A uses another class or interface B,… Read More »

SOLID Principles

[list icon=”arrow” style=”dotted”] Definition ⇒ SOLID is a set of five guiding principles that help developers design objects that are easy to maintain and use. ⇒ SOLID is a guide not goal. ⇒ SOLID is an acronym where: »    S stands for SRP (Single Responsibility principle) »    O stands for OCP (Open closed principle) »    L stands for LSP (Liskov substitution… Read More »