WEBVTT

00:01.200 --> 00:09.870
Hello, everyone, in this session, we will be talking about object oriented programming, so like

00:09.910 --> 00:17.610
other general purpose programming languages, Python is also an object oriented language and it has

00:17.610 --> 00:21.630
been an object object oriented language since its very beginning.

00:22.500 --> 00:28.110
Now it allows us to develop applications using an object oriented approach.

00:28.300 --> 00:30.570
So there are different types of approach.

00:30.590 --> 00:37.980
Overlimit one is object oriented approach and the second approach which we usually have in the programming

00:37.980 --> 00:41.190
languages, is in procedural approach.

00:41.570 --> 00:48.000
OK, so we need to first of all understand what is the difference between object oriented programming

00:48.240 --> 00:50.740
and the procedural programming.

00:51.900 --> 00:59.810
OK, so the object oriented programming is the problem solving approach here.

00:59.860 --> 01:07.570
V you have to do certain computation and these computations are done using different objects.

01:08.610 --> 01:15.330
So when we are using object oriented programming, we are trying to solve a particular problem.

01:15.780 --> 01:23.010
But when we talk about procedural programming, so in case of procedural programming, we are just trying

01:23.010 --> 01:29.590
to follow certain list of procedures or list of instructions step by step.

01:30.180 --> 01:36.720
So let's say I want to find out an area of a circle or area of a triangle or I'm trying to bake a cake

01:37.080 --> 01:45.570
and let's say I'm trying to do certain computation, do something which does not require much complicated

01:45.570 --> 01:48.660
stuff, just steps to be performed.

01:48.990 --> 01:52.380
In that case, I can very well use procedural programming.

01:53.440 --> 02:00.280
But when the problems are a little complex in nature at that point of time, object oriented programming

02:00.280 --> 02:02.770
comes in very useful.

02:03.400 --> 02:10.240
So when we're using object oriented programming, it helps making the development and the maintenance

02:10.240 --> 02:17.380
also very easy to be done by in case of procedural programming, which is very difficult to maintain

02:17.380 --> 02:23.260
the code when the project becomes very lengthy because we don't have any differences that we can go

02:23.260 --> 02:30.490
back to the code and look, we have to read the entire board for that and we might miss out on some

02:30.490 --> 02:31.340
variables there.

02:32.020 --> 02:36.690
But in case of object oriented programming, things are a little more structured in nature.

02:37.090 --> 02:42.850
So it is a little easier to deal with the code, to deal with the larger code when we are talking with

02:42.850 --> 02:44.140
object oriented programming.

02:46.120 --> 02:50.300
Another thing is object oriented programming allows more security.

02:50.710 --> 02:57.370
It allows us to hide the code, which we don't want others to see, I'm sure only the part of the person

02:57.370 --> 02:58.240
has to deal with.

02:58.720 --> 03:00.760
So let's say it's just like a car.

03:00.790 --> 03:04.330
So if I have a car, I want someone to look at the steering wheel.

03:04.330 --> 03:10.720
Only I'm the I don't want someone to go into the mechanics of the good.

03:11.170 --> 03:13.570
I will be building the whole car.

03:13.570 --> 03:16.570
I will be having all the engines and everything.

03:16.900 --> 03:22.120
But the person who is driving the car will only have to worry about how the work with the steering,

03:22.120 --> 03:27.880
the how to work with the brakes and the accelerator, they don't have to worry much about the mechanics

03:27.880 --> 03:28.470
behind it.

03:28.810 --> 03:32.290
So the same thing would be possible to do object oriented programming.

03:32.290 --> 03:34.570
That is, I will be able to hide those things.

03:34.930 --> 03:45.910
I'm not important for the user and only those things that you needed by the user, by in case of the

03:45.910 --> 03:52.840
procedural language, it does not provide any proper V for the binding and the hiding the details.

03:52.840 --> 03:54.840
So it does a little less secure in nature.

03:56.110 --> 03:59.080
So without wasting any time.

04:00.610 --> 04:05.280
Let us go ahead with it now, let us see photo.

04:07.740 --> 04:10.920
So what do we have an object oriented programming.

04:11.850 --> 04:20.500
So in case of object oriented programming, we are designing the program using classes and objects.

04:21.330 --> 04:22.830
So what is a plus?

04:22.830 --> 04:27.560
A plus is nothing but a collection of objects.

04:28.800 --> 04:33.160
So it is a logical entity that has some specific attributes and methods.

04:33.390 --> 04:38.070
So a class will have certain attributes and certain methods.

04:38.100 --> 04:45.740
Now let's say I have a employee class so it will have certain attributes and methods or whatever that

04:45.750 --> 04:53.460
the employee will have salary, the employee will have an email and the employee will have a name.

04:53.610 --> 04:54.810
He will have an age.

04:54.810 --> 04:57.850
He will have some role assigned to him.

04:57.870 --> 05:00.110
So these are different attributes of the employee.

05:00.720 --> 05:03.780
That is some values which are associated with the employee.

05:04.710 --> 05:13.240
Now, the methods associated with the employee could be, let's say, work or a a board.

05:13.410 --> 05:18.910
So these are different methods, typists, certain operations which an employee can perform.

05:20.070 --> 05:29.310
So that is the difference between the attribute and method after that becomes an object.

05:30.300 --> 05:31.470
So what is an object?

05:31.680 --> 05:36.500
Object is an entity that has a stake and a behavior.

05:37.290 --> 05:40.490
So an object will have different state.

05:40.510 --> 05:48.060
So then object can be any of the a life entity, let's say mouse, keyboard, GOP bullpen, person,

05:48.710 --> 05:49.270
animal.

05:49.710 --> 05:55.230
All these could be different objects and their later behavior could be.

05:55.260 --> 05:58.580
So let's say we have an example of a person.

05:58.830 --> 06:07.230
So if I have a person object, so this person object will have different methods or different behavior,

06:07.530 --> 06:11.370
that is the person can while the person can build, the person can eat.

06:11.970 --> 06:15.960
And there would be different attributes associated with that person.

06:15.960 --> 06:18.880
That is the name, age, profession, all these things.

06:19.560 --> 06:25.620
Now the object oriented programming will allow us to group the related things.

06:26.020 --> 06:35.540
So if a person has a different set of tasks like walked out of it so I can group them together now and

06:35.550 --> 06:37.560
a person can have walk, talk, eat.

06:37.770 --> 06:42.170
When I talk about the surgeon, there will be something like perform a surgery.

06:42.390 --> 06:48.420
So this had this is a different kind of task to be performed while Ed will have a different task like

06:48.420 --> 06:53.370
speech so I can group different types of functions for different types of objects to get.

06:54.880 --> 07:02.200
Right, so let's say we have a person right now, this person, one can only eat fruit and this person

07:02.530 --> 07:04.040
can only eat vegetables.

07:04.600 --> 07:05.750
So now what will happen?

07:06.070 --> 07:06.460
The.

07:07.690 --> 07:15.250
It is common with them, both of the people can eat, but one person can eat only fruit and other person

07:15.250 --> 07:16.480
can only eat vegetables.

07:16.660 --> 07:21.660
So here we have different behaviors so we can group different behaviors.

07:21.670 --> 07:25.330
We can segregate those different behaviors in these scenarios.

07:26.650 --> 07:29.920
OK, so this is what allows us to do.

07:29.920 --> 07:35.770
It allows us to create different type of behaviors for different types of object.

07:36.100 --> 07:41.650
And it also allows to group different behaviors based on the properties of object oriented programming,

07:41.650 --> 07:44.610
which we will be learning about later.

07:47.150 --> 07:52.400
Now, why do we need object oriented programming here?

07:52.430 --> 07:59.670
We talked about abortion, we talked about the person object, and this person object has attributes

07:59.690 --> 08:07.400
like name, age, profession, and this person can perform task that does have a method like walk,

08:07.400 --> 08:08.510
talk and eat.

08:10.040 --> 08:16.820
Now, let's see, I want to create different questions, I want to create one person to person, it

08:16.820 --> 08:17.630
will be easier.

08:17.630 --> 08:21.770
I can create one function and the person can perform that.

08:21.770 --> 08:22.970
It is easier to do.

08:23.160 --> 08:23.930
I can do that.

08:24.110 --> 08:27.830
I will need some variables to hold the values.

08:27.830 --> 08:29.960
And I will I can easily afford that.

08:30.350 --> 08:37.930
But let's say I will have to create a thousand person or let's say I have to create that person object

08:37.940 --> 08:40.340
or let's say ten thousand people.

08:41.210 --> 08:50.690
Then in that case I cannot create thousand variables and also keep track of those thousand variables.

08:51.440 --> 08:51.660
Right.

08:51.890 --> 08:57.080
And again, those thousand variables are only in case we have just one variable per person.

08:57.620 --> 09:02.660
But when this person has, let's say, instead of just three and four words, let's say this person

09:02.660 --> 09:06.680
has endless telephone number, I'm different other value.

09:07.010 --> 09:11.750
Let's add five hundred different values and I have ten thousand people.

09:12.020 --> 09:16.640
That makes it more than 50 million values.

09:17.430 --> 09:17.850
Right.

09:17.870 --> 09:25.010
I cannot create 50 million variables because that will actually overburden my entire program and the

09:25.010 --> 09:26.510
program will actually crash.

09:27.200 --> 09:28.630
I cannot have such a thing.

09:29.780 --> 09:33.440
This is where object oriented programming comes into picture.

09:34.280 --> 09:45.440
So object oriented programming will help me create a structured way to actually keep track of my variables

09:45.650 --> 09:50.480
and make things a lot more simpler to implement.

09:52.110 --> 09:55.670
So this is where object oriented programming will come into venture.

09:56.670 --> 10:04.590
Now, the next thing which we will be discussing is the implementation of object oriented programming

10:04.590 --> 10:05.650
and how we will do that.

10:05.970 --> 10:09.870
So let's do that in the next session.

10:10.200 --> 10:10.560
Thank.
