What is OOP?
The OOP paradigm is not based on a formal standard specification. There is not a technical document that defines what OOP is and what it is not. The OOP definition is mainly based on common sense taken from the papers published by early researchers as Kristen Nygaard, Alan Kays, William Cook, and others. There have been many attempts to define OOP and a widely accepted definition to classify a programming language as Object
Oriented is based on two requirements:
- its capability to model a problem through objects
- its support of a few principles that grant modularity and code reuse
In order to satisfy the first requirement, a language must enable a developer to describe the reality using objects and to define relationships among objects such as the following:
- Association: This is the object’s capability to refer another independent object
- Aggregation: This is the object’s capability to embed one or more independent objects
- Composition: This is the object’s capability to embed one or more dependent objects
Commonly, the second requirement is satisfied if a language supports the following principles:
- Encapsulation: This is the capability to concentrate into a single entity data and code that manipulates it, hiding its internal details
- Inheritance: This is the mechanism by which an object acquires some or all features from one or more other objects
- Polymorphism: This is the capability to process objects differently based on their data type or structure
Meeting these requirements is what usually allows us to classify a language as Object Oriented.
OOP without classes