Four Pillars of OOP
The are four pillars of Object-Oriented Programming (OOP) are:
- Abstraction
- Encapsulation
- Inheritance
- Polymorphism
Abstraction
Abstraction is the concept of hiding the complex implementation details and showing only the essential features of the object. It allows users to interact with objects through a simplified interface, without needing to understand the underlying complexity.
Encapsulation
This principle involves bundling the data (attributes) and the methods (functions) that operate on the data into a single unit called an object. It restricts direct access to some of the object’s components, which is a means of preventing unintended interference and misuse of the data.
Inheritance
Inheritance allows a new class to inherit properties and methods from an existing class. This promotes code reusability and establishes a relationship between the parent (superclass) and child (subclass) classes.
Polymorphism
Polymorphism enables objects to be treated as instances of their parent class rather than their actual class. It allows one interface to be used for a general class of actions, with specific behavior being determined at runtime. This can be achieved through method overriding (runtime polymorphism) and method overloading (compile-time polymorphism).
These concepts are intricately integrated into SystemVerilog to ease the process of verification.