OOP/UML/Design Patterns Flashcards
What are the 4 principles of OOP?
Abstraction, inheritance, encapsulation, and polymorphism
What does SOLID stand for?
Single Responsibility, Open-Closed Principle, Liskov Principle, Interface Segregation Principle, Dependency Inversion Principle
What is the single responsibility principle?
A class should only have one reason to change; different classes handle different tasks and problems
What is the Open-Closed Principle?
Classes should be open for extension but closed for modification
What is Liskov’s substitution principle?
You should be able to substitute a base type for a subtype
What is the Interface Segregation Principle?
Don’t put too much into an interface; split into separate interfaces
What is the Dependency Inversion principle?
High level modules should not depend on low level modules