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 »

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 »

Interface Segregation Principle

According to Wikipedia “No client should be forced to depend on methods it does not use”  According to Uncle Bob Martin “Clients should not be forced to depend upon interfaces that they do not use”  »    If there are multiple responsibilities represented by an interface then it becomes difficult to know which methods should be… Read More »

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 »

Open-Closed Principle

    Definition According to Bertrand Meyer: “A class should be open for extension, but closed for modification” According to Wikipedia: “Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.  ” Open for Extension: »    New behavior can be added in the future »    Which means that o    If… 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 »

Object Oriented Relations

Object oriented relationship defines the relation between objects or classes in the system. There are several types of relationships whose are- Dependency (Use-a) Association (Has-a) Aggregation(Has-a) Generalization(Is-a) Dependency Relation Also known as use-a relationship Expresses the relationship between two classes or objects This relationship also known as Supplier-Client relationship Client is dependent on Supplier so… Read More »