1
00:00:00,480 --> 00:00:03,720
IT guys in this section we're going to talk about javascript patterns.

2
00:00:03,750 --> 00:00:09,530
So all programming languages have design patterns that are used in a wide variety of situations.

3
00:00:09,600 --> 00:00:12,800
So this explanation is going to be very generalized.

4
00:00:12,930 --> 00:00:20,220
So pattern is basically a reusable solution that can be applied to occurring problems in software design.

5
00:00:20,250 --> 00:00:25,680
In this case we're talking about javascript applications but all languages have patterns.

6
00:00:25,680 --> 00:00:33,120
You can also think of them as programming templates and a way to to create a specific way for writing

7
00:00:33,120 --> 00:00:33,960
code.

8
00:00:33,960 --> 00:00:36,570
Now the situations vary significantly.

9
00:00:36,570 --> 00:00:41,880
Some patterns like the factory and prototype patterns are used for object creation.

10
00:00:41,910 --> 00:00:46,680
The module pattern and all of its variations are used for overall structure.

11
00:00:46,740 --> 00:00:52,120
Then you have complete software design patterns like MVC which is the model view controller pattern

12
00:00:52,560 --> 00:00:58,920
and these can apply to whole applications or to just little blocks of code.

13
00:00:58,910 --> 00:01:00,810
So it's a very broad subject.

14
00:01:00,810 --> 00:01:06,240
It's a tough subject so in this section I just want to kind of introduce you to some of the patterns

15
00:01:06,240 --> 00:01:08,020
available in javascript.

16
00:01:08,040 --> 00:01:12,600
We've already used some of the patterns and parts of patterns such as the constructor.

17
00:01:12,960 --> 00:01:15,370
The constructor pattern the prototype pattern.

18
00:01:15,540 --> 00:01:21,740
But I want to get more into some some of the specific design patterns that are offered.

19
00:01:21,750 --> 00:01:22,050
All right.

20
00:01:22,050 --> 00:01:28,110
So what we're going to look at is the module pattern and the revealing module pattern which like I said

21
00:01:28,110 --> 00:01:30,010
are used for overall structure.

22
00:01:30,030 --> 00:01:36,540
It allows us to break our code up into modules or we can have private private functions and variables

23
00:01:36,540 --> 00:01:43,710
and public private functions and variables singleton which is kind of a variation of the module pattern

24
00:01:43,950 --> 00:01:46,900
where we can only create one instance of an object.

25
00:01:47,040 --> 00:01:53,070
The factory pattern which is used to create many many objects in the Observer pattern which allows us

26
00:01:53,070 --> 00:01:57,070
to basically subscribe and unsubscribe to events.

27
00:01:57,240 --> 00:02:04,050
The mediator pattern which kind of has a central mediator and then it has colleagues that separate off

28
00:02:04,050 --> 00:02:09,540
from it and then the State pattern which allows us to have a certain state in our application and we

29
00:02:09,540 --> 00:02:11,220
can change that state.

30
00:02:11,220 --> 00:02:16,830
We're actually going to create a little project where we can have a little web site with bootstrap and

31
00:02:16,830 --> 00:02:22,260
we can claim have buttons that we can click to change the state and that'll change the content on the

32
00:02:22,260 --> 00:02:23,190
page.

33
00:02:23,190 --> 00:02:23,490
All right.

34
00:02:23,490 --> 00:02:26,640
So that's all we doing in this video guys are in this section.

35
00:02:26,730 --> 00:02:27,950
So hopefully you enjoy it.

36
00:02:27,960 --> 00:02:29,160
And let's get started.

