very short oop introduction
TRANSCRIPT
OOP IntroductionCristian Gherghinescu
“Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.”
Wikipedia (source of all truth)
Main Selling points
Increase reusability and maintainability
Manage complex systems
Abstraction
Encapsulation
Inheritance
Polymorphism
Abstraction
Grouping the common behaviors
Representing essential features without including the background details or explanations
Hide the implementation
Encapsulation
Separate the contractual interface of an abstraction and its implementation
Allows an object’s behavior to be used without knowing its implementation (“black box”)
Packaging structure and behavior together in one unit - Makes objects more independent
Changes can be done to the behavior implementation without affecting other objects
Inheritance
“Is-a” relationship
Subclass reuses code from the base class (could also override behaviour)
Favor composition (has-a) over inheritance
Polymorphism
One name, many forms.
2 basic types of polymorphism:
Overridding - run-time polymorphismOverloading - compile-time polymorphism.
Thank you !