+ 3
C++ Solid principles
Can anyone help me understand solid principles c++? Has anyone got any code examples?
2 Antworten
+ 2
The term solid have 5different principle:
S-Single Responsibility Principle (SRP)
*This means a class should have only one task to do and not responsible for multi- tasks.
O-Open/Closed Principle
*This means we can add a new functionality for a class without modifying the existing code.
L-Liskov’s Substitution Principle (LSP)
* This means that a derived class should be able to be used in place of its base class without any error.
I-Interface Segregation Principle (ISP)
*This means creating an Interfaces which should be designed for a specific need.
D-Dependency Inversion Principle (DIP)
* High level module should depend on abstractions rather than low level module.
+ 2
Check this code, I've explained SOLID Principles with examples:
https://sololearn.com/compiler-playground/c7tbZp4psrsu/?ref=app