sebap123
sebap123

Reputation: 2685

Object oriented programming paradigms

I've recently stumbled upon interesting question (or maybe only author's mistake) and I've started to question myself. After some research I have to say I am not 100% sure of my answer, so I would like to ask if my thinking is correct. The question is:

Describe object oriented programming paradigms

I was first thinking that this is polymorphism, inheritance, encapsulation, abstraction. But why there is multiple form? As I understood my answer is description of paradigm (single) not paradigms (plural). Did I miss something, or this is correct answer?

Upvotes: 1

Views: 6130

Answers (4)

Ademir Mazer Jr - Nuno
Ademir Mazer Jr - Nuno

Reputation: 900

OOP has its roots in the late 1960s and early 1970s, and it was formally introduced in the late 1980s. The main proponents of OOP were Alan Kay, Bertrand Meyer, and Grady Booch.

The idea behind OOP is to represent real-world objects and their behavior in a computer program. This allows developers to write software that is more intuitive and easier to understand, as well as reuse code by creating objects that can be used in multiple applications.

Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and behavior. In OOP, objects interact with each other by sending messages, and objects can be grouped into classes, which define their shared behavior and data.

OOP has evolved over time, and its use has become widespread in the software industry. Today, several programming languages support OOP, including PHP, Java, Python, C++, Ruby, and more.

Upvotes: 0

Lewis Omwoyo
Lewis Omwoyo

Reputation: 21

Basing my argument on definition of paradigm which is generally a pattern of doing something. The paradigms would be:

  • Abstraction
  • Encapsulation
  • Polymorphism
  • Inheritance.

Upvotes: 2

Florian Salihovic
Florian Salihovic

Reputation: 3951

You might want to check out what Alan Kay has to say about this: http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented

The necessary excerpts from the link:

This definition is derived from early versions of Smalltalk (Smalltalk-72?), and rules 5 and 6 clearly show Smalltalk's Lisp heritage. Kay remarked as such, noting that rules 4-6 would mutate as Smalltalk developed.

  1. EverythingIsAnObject.
  2. Objects communicate by sending and receiving messages (in terms of objects).
  3. Objects have their own memory (in terms of objects).
  4. Every object is an instance of a class (which must be an object).
  5. The class holds the shared behavior for its instances (in the form of objects in a program list)
  6. To eval a program list, control is passed to the first object and the remainder is treated as its message.

"Alan Kay, considered by some to be the father of object-oriented programming, identified the following characteristics as fundamental to OOP:"

  1. EverythingIsAnObject.
  2. Communication is performed by objects communicating with each other, requesting that objects perform actions. Objects communicate by sending and receiving messages. A message is a request for action, bundled with whatever objects may be necessary to complete the task.
  3. Objects have their own memory, which consists of other objects.
  4. Every object is an instance of a class. A class simply represents a grouping of similar objects, such as integers or lists.
  5. The class is the repository for behavior associated with an object. That is, all objects that are instances of the same class can perform the same actions. So far, similar to 1-5 above. Rule 6 is different. The reference to lists is removed, instead we have:
  6. Classes are organized into a singly-rooted tree structure, called the inheritance hierarchy. Memory and behavior associated with instances of a class are available to any class associated with a descendent in this tree structure.

Upvotes: 1

bogl
bogl

Reputation: 1863

It depends on the viewing angle, better to say on the granularity, or what do you want to compare or emphasize.

Object oriented programming is one programming paradigm among others. But then there are different categories of object oriented programming. It makes sense to call the plurality of them object oriented programming paradigms.

See https://en.wikipedia.org/wiki/Object-oriented_programming for a beautiful list of programming paradigms.

Upvotes: 0

Related Questions