about summary refs log tree commit diff
path: root/usth/ICT2.7/P3L3 Design Patterns Subtitles/10 - Choosing a Pattern - lang_en_vs5.srt
blob: f27344117f9191d1985b21bc7a0ec2ba91b6f821 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
1
00:00:00,150 --> 00:00:03,200
But with so many patterns, how do we choose a pattern? So

2
00:00:03,200 --> 00:00:05,970
this is a possible approach that you can follow. First of all, you

3
00:00:05,970 --> 00:00:09,140
want to make sure that you understand your design context. You understand

4
00:00:09,140 --> 00:00:12,800
what you're designing and what are the issues involved with this design. What

5
00:00:12,800 --> 00:00:15,200
are the problems that you need to solve. At this point, you

6
00:00:15,200 --> 00:00:17,160
can examine the patterns catalog, or,if

7
00:00:17,160 --> 00:00:18,750
you're already familiar with the catalog, just

8
00:00:18,750 --> 00:00:22,430
think about the possible patterns that you could use. Once you identify

9
00:00:22,430 --> 00:00:25,440
the patterns that you can use, you also want to study them and

10
00:00:25,440 --> 00:00:29,090
study the related patterns. So normally if you look at any pattern catalog,

11
00:00:29,090 --> 00:00:32,229
for each pattern there will also be a list of related patterns. So

12
00:00:32,229 --> 00:00:35,010
you can also look at those to see whether maybe some of those

13
00:00:35,010 --> 00:00:38,370
might be more applicable. And finally, once you identify the pattern that you

14
00:00:38,370 --> 00:00:41,360
think is appropriate, you will apply that pattern. When you do that, just

15
00:00:41,360 --> 00:00:44,850
be mindful that there are pitfalls in the use of patterns. One obvious

16
00:00:44,850 --> 00:00:47,490
one is the fact that you might select the wrong pattern and make

17
00:00:47,490 --> 00:00:50,460
your design worse instead of better. The second one is that if you

18
00:00:50,460 --> 00:00:52,560
get too excited about patterns, then you

19
00:00:52,560 --> 00:00:54,850
might be abusing patterns, so just using too

20
00:00:54,850 --> 00:00:56,370
many patterns, and end up with a design

21
00:00:56,370 --> 00:00:58,980
that is more complicated rather than less complicated.

22
00:00:58,980 --> 00:01:01,890
So always be careful, spend the time to figure out which one is the right

23
00:01:01,890 --> 00:01:03,577
pattern to apply, and make sure that you

24
00:01:03,577 --> 00:01:05,190
don't use patterns that you don't actually need.