1
00:00:00,180 --> 00:00:01,260
[Autogenerated] the adapter pattern is

2
00:00:01,260 --> 00:00:03,300
related to a number of other patterns,

3
00:00:03,300 --> 00:00:06,280
either in structure or usage. The

4
00:00:06,280 --> 00:00:09,070
decorator has a similar structure, but the

5
00:00:09,070 --> 00:00:11,140
intent of a decorator is to add

6
00:00:11,140 --> 00:00:14,240
functionality. Likewise, the bridge

7
00:00:14,240 --> 00:00:16,630
pattern is very similar in structure, but

8
00:00:16,630 --> 00:00:18,980
it's in 10 specifically is to allow

9
00:00:18,980 --> 00:00:21,370
interfaces and their implementations to

10
00:00:21,370 --> 00:00:24,620
vary independently from one another, and

11
00:00:24,620 --> 00:00:27,040
the proxy is structurally similar as well.

12
00:00:27,040 --> 00:00:29,110
But its intent is to control access to a

13
00:00:29,110 --> 00:00:31,600
resource, not to convert an incompatible

14
00:00:31,600 --> 00:00:34,730
interface. Remember that patterns are not

15
00:00:34,730 --> 00:00:36,170
just about the different ways of

16
00:00:36,170 --> 00:00:38,620
structuring your code, but also about

17
00:00:38,620 --> 00:00:41,620
communicating design intent. Here we have

18
00:00:41,620 --> 00:00:43,790
four different patterns the three shown,

19
00:00:43,790 --> 00:00:46,030
plus the adapter that each are very

20
00:00:46,030 --> 00:00:48,140
similar on paper but which have different

21
00:00:48,140 --> 00:00:51,510
names to reflect how they're used.

22
00:00:51,510 --> 00:00:54,030
Sometimes the repositories Pattern X is an

23
00:00:54,030 --> 00:00:56,300
adapter, providing a common interface for

24
00:00:56,300 --> 00:00:58,380
persistence that can map various

25
00:00:58,380 --> 00:01:01,330
incompatible interfaces to a single common

26
00:01:01,330 --> 00:01:04,180
data access strategy. And speaking of

27
00:01:04,180 --> 00:01:06,620
strategy, the strategy pattern is very

28
00:01:06,620 --> 00:01:08,680
frequently used with the adapter pattern

29
00:01:08,680 --> 00:01:10,080
as a way of injecting different

30
00:01:10,080 --> 00:01:12,560
implementations of behavior into a

31
00:01:12,560 --> 00:01:16,160
particular client class. Finally, the

32
00:01:16,160 --> 00:01:18,560
intent of the facade is similar to the

33
00:01:18,560 --> 00:01:21,070
adapters in that it alters an interface to

34
00:01:21,070 --> 00:01:23,510
make it easier for a client to use. The

35
00:01:23,510 --> 00:01:25,580
difference, though, is that the facade

36
00:01:25,580 --> 00:01:27,940
often sits in front of multiple different

37
00:01:27,940 --> 00:01:31,240
types in its goal is to simplify a complex

38
00:01:31,240 --> 00:01:33,500
set of operation, not necessarily to

39
00:01:33,500 --> 00:01:38,000
provide a way too easily swap between different, incompatible operations.

