This is the last blog post about the SOLID principles in object-oriented programming and we talk about the Dependency Inversion Principle (DIP).
The principle states:
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.
Continua a leggere SOLID principles by example: Dependency inversion
This post continues the analisys of the SOLID principles and it’s about the Interface Segregration Principle (ISP).
The interface-segregation principle (ISP) states that no client should be forced to depend on methods it does not use.
Continua a leggere SOLID principles by example: Interface segregation
This post continues the analisys of the SOLID principles started some blog posts ago. This is the turn for the Open Closed Priciple (OCP).
An object/entity should be open for extension but closed for modification.
What we are basically talking about is to design our modules, classes and functions in a way that when a new functionality is needed, we should not modify our existing code but rather write new code that will be used by existing code.
Continua a leggere SOLID principles by examples: open/closed