INITIALIZING SECURE CHANNEL...
CPU MEM NET PING9.2 ms SECSECURED
COFFEE—WEB v4.0 // eu-1
ONLINE 2 847 --:--:--
/english > 15. Object-Oriented Programming
// УРОК 15

Object-Oriented Programming

B1

Object-Oriented Programming Vocabulary

The Four Pillars of OOP

PillarMeaningExample Phrase
EncapsulationHiding internal state, exposing only an interface"We encapsulate the payment logic inside the PaymentService class."
InheritanceA class inherits properties/methods from a parent class"AdminUser inherits from the base User class."
PolymorphismDifferent classes respond to the same interface differently"Both SQLRepository and MongoRepository implement the same interface."
AbstractionHiding complexity behind a simple interface"The client doesn't need to know how the data is stored."

SOLID Principles (brief)

  • S — Single Responsibility: a class should do one thing
  • O — Open/Closed: open for extension, closed for modification
  • D — Dependency Inversion: depend on abstractions, not implementations
// TERMINAL CHALLENGE

Проверь себя

Q1. What is 'encapsulation' in OOP?
Q2. What does 'polymorphism' allow you to do?
Q3. What does the S in SOLID stand for?
Q4. Complete: 'AdminUser ___ from the base User class and adds permission checks.'
Q5. What does 'abstraction' mean in OOP?
╔═ GL1TCH v0.1 ═[ПОДКЛЮЧЕНО]═╗ [×]
СОЕДИНЕНИЕ АКТИВНО
запросов:
// сессия #{} начата
>_
[ РАЗРЫВ СВЯЗИ ]
лимит исчерпан...
иду спать... zzZ
хочешь больше? [зарегистрироваться] // +10 запросов в день