OOP terminology

OOP Terminology

Classes:

Methods:

Attributes:

Main principles

Encapsulation

Bundling of data (attributes) and methods that operate on that data within one unit, typically a class.

Polymorphism

Polymorphism allows objects of different classes to be treated as objects of a common superclass.

Polymorphism is usually (for example in Python) achieved through method overriding. This allows for the same method name to be used for different types of objects.

Abstraction

Abstraction is a process of hiding implementation details and showing only the functionality to the user. For example, abstraction in Python is achived through ABC from «abc» lib.

Inheritance

Inheritance is mechanism that allows one class to acquire (inherit) methods and attributes of it’s superclass. Those methods can then be overriden or extended.

Python supports single and multiple inheritance (class can inherit from multiple superclasses).