SOLID design principles Flashcards
what are the solid principles
single responsibility open closed liskov's substitution interface segregation dependency inversion
they are design principles for OOP
single responsibility
concept of a class doing one specific thing and not trying to do more than it should (high cohesion)
states that every module, class or function should have responsibility over a single part of the functionaility and that responsibility should be entirely encapsulated by that class
monster/god class
high cohesion - i.e. class is doing too much
open closed
software entities should be open for extension by closed for modification. can allow behavior to be extended without modifying existing code
add new code without having to change to existing code
Liskov substitution
ensuring that inheritance is used correctly
interface segregation
clients should not be forced to depend on methods that they do not use. devs should favor thing interfaces
dependency inversion
The Dependency Inversion principle states that our classes should depend upon interfaces or abstract classes instead of concrete classes and functions.