SOLID + OOP principles

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:09 AM on 4/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

7 Terms

1
New cards

OOP 4 principles

  • abstraction

  • inheritance

  • polymorphism

  • data encapsulation

2
New cards

SOLID abbrev for?

  • SRP - single responsibility principle

  • OCP - open close principle

  • LSP - Liskov substitution principle

  • ISP - interface segregation principle

  • DIP - dependency inversion principle

3
New cards

SRP - single responsibility principle

  • avoids bloated classes - one class should have a single responsibility - a single reason to change

4
New cards

OCP - open close principle

A class should be open to extension and closed to change. → no need to retest old code, backward compatibility, adaptability

usually achieved through inheritance

5
New cards

LSP - Liskov substitution principle

  • Subclass should be able to substitute parent class → if subclass implements a method and throws UnsupportedMethodException, that will break this!

6
New cards

ISP - interface segregation principle

Avoids bloated interfaces. Implement only interfaces if all the methods from it are needed, otherwise break the interface apart.

7
New cards

DIP - dependency inversion principle

  • a high level class shouldn’t depend on a low level one. High level - declares the what, low level - declared the how, the details. Use Interface, abstraction instead if implementation dependencies

  • An abstraction shouldn’t depend on implementations. If an implementation needs new feature, you shouldn’t modify the base abstraction.