‫Okay.
‫So in this section we're going to be looking at object oriented programming also called OOP.
‫And this is a fundamental programming paradigm that's based on the concept of objects.
‫So you can think of all your entities in your program as objects that have properties or attributes
‫and can do stuff through functions which are called methods.
‫And your code is structured to model real world entities and their interactions within your program.
‫And we use something called a class to model these entities or objects.
‫So a class is basically a blueprint.
‫Now object oriented programming is widely used in many languages such as PHP, Java, C, sharp, even
‫lower level languages like C plus, plus.
‫And with most languages including PHP, there are multiple paradigms to choose from.
‫So in this course so far we've been we've been writing procedural code.
‫So that's the paradigm we've been using.
‫And there's others as well including functional programming.
‫So there's just a couple concepts that I want to go over real quick that are key in object oriented
‫programming.
‫So obviously objects it's a it's a self-contained unit that encapsulates both data in the form of attributes
‫and functions in the form of methods.
‫For example, in a real world scenario, a car can be represented as an object with attributes like
‫the color, the make, the model, along with methods like start and stop.
‫So in a similar way, in your program, a user object in a web application can have attributes like
‫name, email, password along with methods like log in and log out.
‫All right.
‫Then we have classes which, like I said, are basically a blueprint for creating objects.
‫And I mean, technically you could create a class for a car.
‫You know, obviously it's not going to do what an actual car does.
‫It could if it was some kind of game, but it could have properties like the make model, and then it
‫could have methods like start and stop.
‫So inheritance is also really important in object oriented programming.
‫And this is a mechanism that allows one class to inherit the properties and methods of another class.
‫And it promotes code reusability and establishes a hierarchy of classes.
‫So for instance, you might have a base class called vehicle and then have classes like car and motorcycle
‫that can inherit from it and inherit common properties and and methods.
‫Similarly, you can have an admin class that can inherit from a user class.
‫Inheriting common attributes like name and email.
‫Encapsulation refers to the practice of bundling the data or the attributes and the methods or functions
‫that operate on the data within a single unit.
‫Otherwise, it's called an object, and this unit protects the data from unauthorized access and manipulation,
‫and it ensures data integrity.
‫So it's like having a car with the engine and other components enclosed within a sealed hood.
‫Then we have polymorphism, which can be kind of difficult to understand.
‫But just as a general definition, it allows objects of different classes to be treated as objects of
‫a common superclass.
‫So it enables flexibility in method calls, allowing different classes to provide their own implementations
‫of methods.
‫So for instance, both car and motorcycle.
‫If those were classes, they can both have a start method, but they may behave differently when started.
‫Okay, so those are just some some core concepts to to be aware of when working with object oriented
‫programming.
‫So the benefits of OOP.
‫We have modularity.
‫So OOP promotes modular design making it easier to manage and maintain really complex systems.
‫So when you're building, you know, really advanced systems, object oriented programming is usually
‫a good way to go.
‫So each object can be developed and tested independently.
‫You might have one developer working on one set of objects and another working on another.
‫And they don't they don't really know about each other because it's that modular reusability is also
‫really important.
‫So it's often written in a way where, you know, once you've created a class, you can use it to create
‫multiple instances throughout your program.
‫Scalability.
‫So object oriented programming facilitates the scaling of software systems.
‫You can extend existing classes or create new ones to add functionality without disrupting existing
‫code.
‫And then we have abstraction.
‫So it allows you to abstract complex systems by modeling them with simplified objects.
‫And this abstraction simplifies.
‫Problem solving and system design.
‫So I know that that's kind of a mouthful.
‫I just wanted to kind of share what object oriented programming is all about.
‫So these four benefits are huge.
‫And there's more as well.
‫But these are the kind of the main ones and those are the concepts we went over.
‫You just want to be aware of those as well.
‫So we're going to start from absolute scratch in the next video.
‫We're going to just create a class.
‫So we'll talk about what a class is and what that entails.