1

00:00:06,870  -->  00:00:07,920
Hi there.

2

00:00:07,920  -->  00:00:09,050
This is Day to do.

3

00:00:09,120  -->  00:00:10,620
And welcome back.

4

00:00:10,620  -->  00:00:16,050
Let's extend Tullio to add a new requirement under some interesting requirement which part still gets

5

00:00:16,690  -->  00:00:23,520
unequal to enable us to learn about another cool object oriented feature Angela and the new requirement

6

00:00:23,640  -->  00:00:30,310
is to add a new app just pockets and it would display only bookmarks which are relevant toolkits.

7

00:00:30,360  -->  00:00:36,330
For example as shown here we can have a new menu item called gets and clicking on it will display only

8

00:00:36,530  -->  00:00:38,350
kid friendly bookmarks.

9

00:00:38,370  -->  00:00:44,970
This is not that the existing system under something we plan to add in future will get some specific

10

00:00:44,970  -->  00:00:51,780
details related to the new requirement only editorial stuff like the content editors should be able

11

00:00:51,780  -->  00:00:54,240
to market bookmark as kid friendly.

12

00:00:54,630  -->  00:00:59,700
And if a bookmark is not yet approved as pet friendly then a link with the title Mark Guscott friendly

13

00:00:59,790  -->  00:01:02,090
will be disappeared with double back.

14

00:01:02,190  -->  00:01:08,760
However such a link will not be shown if the bookmark is clearly not eligible for it from Mr. dys good

15

00:01:08,760  -->  00:01:13,060
examples would be Mobius and John and horror movies.

16

00:01:13,200  -->  00:01:20,790
So basically only bookmarks that are MMOG best Cutrone show under Section no so far our class trigrams

17

00:01:21,000  -->  00:01:24,480
include different user types and their capabilities.

18

00:01:24,480  -->  00:01:29,730
Let's introduce some new classes since it is a bookmarking app and we know that will you allows us to

19

00:01:29,730  -->  00:01:32,180
bookmark LeBlanc's movies and books.

20

00:01:32,310  -->  00:01:36,100
We can have three classes representing these three different bookmark.

21

00:01:37,020  -->  00:01:43,230
And these three classes would extend the superclass called bookmark and bookmarked last defensive for

22

00:01:43,290  -->  00:01:47,960
instance variables ID title description and profile you are in.

23

00:01:48,480  -->  00:01:50,740
ID is simply the primary key of the bookmark.

24

00:01:50,760  -->  00:01:58,770
Indeed obvious so it uniquely identifies each bookmark title and description simply represent the title

25

00:01:58,770  -->  00:02:01,800
and description of the bookmark like the movie name.

26

00:02:01,830  -->  00:02:07,470
A short description of the movie profile you are in is that you want to know if the web page that has

27

00:02:07,560  -->  00:02:14,370
information that is specific with a bookmark bookmark class also defines two methods Genelec profile

28

00:02:14,370  -->  00:02:21,450
you aren't an easy kid friendly eligible mentored both of which are awarded and subprocess.

29

00:02:22,230  -->  00:02:24,750
Let's just look at what Jenrette profile you are.

30

00:02:24,750  -->  00:02:30,030
The method is responsible for let's consider this movie named into the wine.

31

00:02:30,120  -->  00:02:36,270
It's an interesting movie and for this movie the gender profile you are limited in the more B-class

32

00:02:36,810  -->  00:02:42,870
would generate this kind of a text which is assigned to the profile you already know the first part

33

00:02:42,870  -->  00:02:49,680
in the text which is the movie followed by Slash is generated by this method while for the remaining

34

00:02:49,680  -->  00:02:54,250
part the genetic profile you are on the method in the superclass is invoked.

35

00:02:54,480  -->  00:02:58,370
So it is invoked from the surplus in the browser.

36

00:02:58,380  -->  00:03:02,720
However you will see the full on and that is the text trail that I want.

37

00:03:02,790  -->  00:03:07,800
Followed by a slash which is then followed by this text generated by the generate profile you are the

38

00:03:07,800  -->  00:03:09,050
matter.

39

00:03:09,060  -->  00:03:13,970
That's because the prefix rule that I want will be automatically added by the website.

40

00:03:14,670  -->  00:03:20,500
So the Spross abortion is generating the subclass related text like the movie followed by Slash.

41

00:03:20,530  -->  00:03:27,310
Why did the super motion gender's the remaining part from the bookmarks title not fit to the general

42

00:03:27,330  -->  00:03:33,540
profile you are limited in the book plus it will generate that text book followed by Slash.

43

00:03:33,600  -->  00:03:37,760
While for the remaining text it would invoke the superclass portion.

44

00:03:38,040  -->  00:03:44,130
Next the second method is good for only eligible is responsible for deciding whether or not to display

45

00:03:44,310  -->  00:03:45,300
the link Mark.

46

00:03:45,360  -->  00:03:53,130
Ask a friendly with each bookmark so defines the base eligibility criteria to make such a decision.

47

00:03:53,130  -->  00:03:58,840
Hello bookmark class is too generic to how any specific implementation for this method.

48

00:03:58,850  -->  00:04:05,340
So implementation is supply specific on Hansis over it and for example you get friendly eligible method

49

00:04:05,350  -->  00:04:05,480
.

50

00:04:05,550  -->  00:04:12,410
In the movie class would return false if movie is off only so you can get something of the sort.

51

00:04:12,420  -->  00:04:14,600
Defined in the book márquez.

52

00:04:14,730  -->  00:04:21,120
However the method will still be present in the bookmark class as it would help in defining the contract

53

00:04:21,120  -->  00:04:29,220
for a process that is a common protocol for subprocess which is very important for polymorphism.

54

00:04:29,220  -->  00:04:35,010
Finally you can also see some instance variables that are specific to the classes book on movie and

55

00:04:35,010  -->  00:04:41,220
there are no instance variables which are specific to rebeling class knowledge or could some technical

56

00:04:41,220  -->  00:04:47,820
requirements that be how it would be nice if bookmark class is non instantiation.

57

00:04:47,820  -->  00:04:51,320
The reason is as mentioned earlier is just too generic.

58

00:04:51,380  -->  00:04:55,530
Or let's say abstract to have any implementation for one of its methods.

59

00:04:55,600  -->  00:04:58,520
Which is does the east Cutrone eligible method.

60

00:04:58,620  -->  00:05:01,460
So you can assume having an empty body for this method.

61

00:05:01,740  -->  00:05:06,560
So semantically it just doesn't make sense to create a bookmark object.

62

00:05:06,700  -->  00:05:12,360
Just imagine creating a bookmark object and then invoking the east get from the original method which

63

00:05:12,360  -->  00:05:14,940
simply doesn't have any implementation.

64

00:05:14,940  -->  00:05:19,010
It makes sense to invoke such a method on a movie or a book object.

65

00:05:19,360  -->  00:05:24,140
As these classes can define some specific criteria for this matter.

66

00:05:24,330  -->  00:05:31,250
So bookmark class should be non-instructional And can you think of any way to achieve this.

67

00:05:31,260  -->  00:05:37,540
No you miss it that we can have a private constructor as it prevents instantiation But we also know

68

00:05:37,540  -->  00:05:43,170
that it prevents inheritance so it doesn't work and we need something new.

69

00:05:44,050  -->  00:05:50,400
Now similarly another requirement is that it would be nice to avoid having empty body for ease geek

70

00:05:50,400  -->  00:05:53,430
friendly and jamon matter within the bookmark gloss.

71

00:05:53,730  -->  00:06:01,050
That is some kind of an explicit syntax to indicate that this method is too abstract to have any implementation

72

00:06:01,050  -->  00:06:01,770
.

73

00:06:02,130  -->  00:06:08,460
So these two requirements can be addressed by a new feature called abstract class which can how abstract

74

00:06:08,460  -->  00:06:09,880
methods.

75

00:06:09,990  -->  00:06:13,340
So next let's look at abstract losses and methods.

76

00:06:13,500  -->  00:06:13,890
Thank you
