1

00:00:00,990  -->  00:00:08,750
Let's not create constant exporting classes the classes that exist only for defining constants.

2

00:00:09,150  -->  00:00:16,170
For example we have Jondrette fill in book and movie classes and it has a range of values in each of

3

00:00:16,170  -->  00:00:17,880
those domains.

4

00:00:17,910  -->  00:00:23,760
So instead of defining these values in databases we can also define them in a constant exploding class

5

00:00:23,760  -->  00:00:24,870
.

6

00:00:24,870  -->  00:00:31,810
Similarly range of values for gender field in use class cannot be defined using constant exporting class

7

00:00:32,640  -->  00:00:37,200
and we can do the same for user type feel within the user class.

8

00:00:37,290  -->  00:00:43,130
These classes will be useful when we have to check if the field has a particular value.

9

00:00:43,200  -->  00:00:50,400
For example if we want to check if a particular book belongs to a certain genre then the constant exporting

10

00:00:50,400  -->  00:00:54,120
class corresponding to this feature will be useful.

11

00:00:54,120  -->  00:00:58,700
We will see this when we later implement east kid friendly eligible method.

12

00:00:58,890  -->  00:01:00,600
So these classes are useful.

13

00:01:00,600  -->  00:01:02,640
And let's go ahead and create them.

14

00:01:03,030  -->  00:01:05,280
Let's first create a new package for constants

15

00:01:05,300  -->  00:01:11,360
.

16

00:01:20,700  -->  00:01:25,010
So it's semantics were really are constants.

17

00:01:25,710  -->  00:01:29,490
Let's create a constant exporting class called user type

18

00:01:36,570  -->  00:01:39,570
since it's going to expose only the constants.

19

00:01:39,600  -->  00:01:44,450
So there are no instance variables are there are no methods in this class.

20

00:01:44,520  -->  00:01:50,880
So it's just going to be static final peak of Feels so that it's compile time constants so we don't

21

00:01:50,880  -->  00:01:58,990
need to create an instance of this class so we can define a private constructor.

22

00:02:02,760  -->  00:02:04,380
Now let's define the constants

23

00:02:13,620  -->  00:02:19,380
since it's a compile time constant we need to use all caps.

24

00:02:19,380  -->  00:02:25,250
That's the convention we know that it's got it as user.

25

00:02:25,530  -->  00:02:32,320
Now let's simply copy this.

26

00:02:32,460  -->  00:02:37,380
So let's call the second one as student editor

27

00:02:41,760  -->  00:02:48,450
and Thirty-One chief editor.

28

00:02:52,590  -->  00:02:54,700
Okay so that's a user type class.

29

00:02:54,750  -->  00:02:56,970
Let's create one for gender

30

00:03:06,770  -->  00:03:08,630
in the private constructor

31

00:03:13,560  -->  00:03:17,990
and the gender field is here.

32

00:03:18,540  -->  00:03:22,320
So let's go ahead and create three constants

33

00:03:22,340  -->  00:03:31,270
.

34

00:03:31,320  -->  00:03:32,610
Initialize it with zero

35

00:03:43,070  -->  00:03:43,920
to two on

36

00:03:50,370  -->  00:03:51,390
transgender.

37

00:03:51,390  -->  00:03:52,880
Make it two.

38

00:03:53,610  -->  00:03:57,420
So that's the gender class.

39

00:03:57,420  -->  00:04:03,960
And we also need to do more for the genre for book genre and movie joinery and I'm just going to create

40

00:04:03,960  -->  00:04:07,890
them off line as darling dear and that's much better.

41

00:04:07,890  -->  00:04:09,610
It will say for some time.

42

00:04:09,670  -->  00:04:13,700
So let me just create it off line and I'll come back and show it to you.

43

00:04:14,730  -->  00:04:14,990
OK.

44

00:04:14,990  -->  00:04:19,710
Here's a book John reckless and these are all the constants that it has.

45

00:04:20,190  -->  00:04:22,020
And it's in the Constans package.

46

00:04:22,260  -->  00:04:30,270
And here is a movie class and it has a lot of constants as you can see here the different genres classics

47

00:04:30,270  -->  00:04:33,350
drama comedy and so on.

48

00:04:33,870  -->  00:04:39,540
I'm going to upload the book movie genre and book Journey to the resources section so you can just download

49

00:04:39,540  -->  00:04:43,080
them and that's it.

50

00:04:43,080  -->  00:04:47,880
So those are the four constant exporting classes that we have created.

51

00:04:48,450  -->  00:04:49,020
And that's a
