**5 principles for Object-Oriented Programming** # SOLID is an acronym for: ## Single-Responsibility > [!success] 👉 A class should have one and only one reason to change, meaning that a class should have only one job. ## Open-closed > [!success] 👉 Objects or entities should be open for extension but closed for modification. ## Liskov Substitution > [!success] 👉 Every subclass should be substitutable for the base or parent class ## Interface Segregation > [!success] 👉 A class shouldn’t be forced to implement an interface that it doesn’t use or depend on methods it doesn’t use ## Dependency-Inversion > [!success] 👉 Don’t have a class depend explicitly on another class, have an abstract interface between them This last one seems weird. **** ## Source - [[SOLID OOP Principles]] ## Related - [[DRY (Don't Repeat Yourself)]] - [[DRY (Don't Repeat Yourself)]] - [[DRY (Don't Repeat Yourself)]]