Object-Oriented Programming (OOP)

Object-Oriented Programming (OOP)

What is it?

Object-Oriented Programming (OOP) is a way of writing computer programs that are using the idea of "objects" to represent data and methods.

Not only that, but it also uses some concepts to make everything more magical.

An "object" is the basic unit of OOP. It's a unit formed by properties (data and functions) built from a blueprint. A car can be an object.

A class is a blueprint for creating objects. Car blueprints are defined with essential attributes such as type, fuel, etc. and behavior such as acceleration, braking, etc. In this way, it's possible to produce cars in series using the blueprint, without rebuilding the machine from scratch each time.


Abstraction

Abstraction means to represent the essential feature of a module without detailing the internal working detail. A driver that uses the acceleration system doesn't know how it works precisely at the engineering level, he/she only knows that if he/she presses the pedal, the machine accelerates.


Encapsulation

Encapsulation is exposing a solution to a problem without requiring to fully understand the problem domain. In F1 teams, who manage the acceleration system, they don't need to know how the lighting system works internally, they just need to see what connections are made available by the latter to be able to use it.


Inheritance

Inheritance is a concept to describe hierarchies in such a way as to make it possible for those below in the hierarchy to inherit attributes and behavior from those higher up. Tesla Model X is an SUV. And because it is an SUV. it is, therefore, a Car, and it is a Car. it is, therefore, a Vehicle.


Polymorphism

Polymorphism serves to define different implementations of the same object. Cars can have different fuels although they are all cars. So you can use the car object as a base and define various implementations, such as electric cars, petrol cars, diesel cars, hybrid cars, etc.


Source: @goodrella

要查看或添加评论,请登录

Ahmed El-Agawy ????的更多文章

  • Learning How to Learn, "Interleaving"

    Learning How to Learn, "Interleaving"

    One significant mistake #students sometimes make in #learning is jumping into the water before they learn to swim. In…

  • 8 Types of Cyber Attacks

    8 Types of Cyber Attacks

    Malware Short for #malicious #software, this is a type of unwanted software that is installed without your consent…

  • How do Web Servers work?

    How do Web Servers work?

    Web Server The term web server can refer to #hardware or #software or both of them working together. On the #hardware…

  • Hackers Start New Campaign Using Coronavirus to Launch Emotet Trojan

    Hackers Start New Campaign Using Coronavirus to Launch Emotet Trojan

    Hackers have embarked on another campaign taking advantage of the global fear of the coronavirus to get targets open a…

  • Levels of English Language A, B, and C.

    Levels of English Language A, B, and C.

    A1 You can understand and use familiar everyday expressions and very basic phrases aimed at the satisfaction of needs…

  • 7 Phases of the Software Development Life Cycle (SDLC)

    7 Phases of the Software Development Life Cycle (SDLC)

    1. PLANNING #Planning focuses on the scope of the #project.

  • Top Modern JavaScript Books

    Top Modern JavaScript Books

    Eloquent JavaScript By: Marijin Haverbeke This is a book about #JavaScript, #programming, and the wonders of the…

    2 条评论
  • Top Programming Interview Questions

    Top Programming Interview Questions

    0. Arrays How do you remove duplicates from an array? How do you reverse an array? How do you find the 2nd largest…

  • Life Lessons From Programming

    Life Lessons From Programming

    Being Self-Driven is tough but vital! The sooner you learn that you're the only person who can solve your problems, the…

  • Key Mindsets of Expert Developers

    Key Mindsets of Expert Developers

    Master Debugging The ability to debug effectively has a disproportionately large impact on a programmer's ability to…

社区洞察

其他会员也浏览了