DEV Community

Kiana
Kiana

Posted on

Object Oriented Programming

"As humans, we’re constantly faced with myriad facts and impressions that we must make sense of. To do so, we must abstract underlying structure away from surface details and discover the fundamental relations at work. Abstractions reveal causes and effects, expose patterns and frameworks, and separate what’s important from what’s not. Object orientation provides an abstraction of the data on which you operate; moreover, it provides a concrete grouping between the data and the operations you can perform with the data—in effect giving the data behavior."
—Object-Oriented Programming with Objective-C, Apple Inc.

OOP is exactly what an inexperienced programmer might guess...programming structure that is oriented around objects. smaller functionalities(objects) that can have specific behaviors(methods/attributes) bundle up in a way that executes a larger logical functionality(classes). Each object has values defined in its class resulting in a simple structure with less duplicate code.

                     Basic structure of OOP:
Enter fullscreen mode Exit fullscreen mode
  1. Classes --> the top structure of methods/attributes
  2. Objects--> instances of a class with specific data

    3.Methods--> behaviors/actions performed on data

    4.Attributes--> information that is stored via the class

                       Four pillars of OOP:
    
  3. Inheritance-->child classes getting data from a parent class

  4. Encapsulation-->displaying specific info from an object

  5. Abstraction--> accessing a specific object

  6. Polymorphism--> shared behavior of methods

Object Oriented programming really just means to think about the structure of the program at the beginning of your projects. Planning ahead of how to create simple objects and reusable classes will help with maintaining an easier flow of logic when working on a project. OOP is just one way to build an efficient data structure with reusability.

Top comments (0)