4 Pillars of OOP
A PIE: Abstraction, Polymorphism, Inheritance, and Encapsulation.
Abstraction
hiding complex code from user; user is only concerned with inputs/outputs, don’t need to worry about internal components; abstraction creates reusable/discrete modules; write something once and use it anywhere to fulfill task in application; single task as a method; group of tasks as class; group of related classes as layer.
Polymorphism
Inheritance
Encapsulation
maximizing cohesion by grouping related elements together; wrap cohesive elements together, protect access by making them private, limit access via getters/setters so you have precise control over how data stored/retrieved
Cohesion
togetherness; extent to which elements of code belong together.
Coupling
measurement of dependency between classes; if I change sth. in class A, does it break functionality in class B?