Tag Archives: design-principles

Liscov Substitution Principle

Barbara Liscov defined this principle as follows: “If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.” According to Uncle Bob Martin… Read More »

Single Responsibility Principle

Definition: According to Uncle Bob Martin “A class should have one, and only one, reason to change” According to Wikipedia “Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class.  ” Applicability:  We can apply this idea into different level of our code such as: »    Method/Function:  … 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 »