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