跟讀練習: What are Design Patterns? | Introduction to Design Patterns and Principles | Geekific - 通過影片學習英語口語
選擇練習模式
每種模式都會開啟全屏練習室。
11 句
如果句子過短或過長,請點選 Edit 進行調整。
1
What's up geeks and welcome to the channel! If you're in the computer science domain you definitely have heard of design patterns before or even used a few patterns in practice with or without your knowledge but really what are design patterns?
2
why were they created in the first place and who decided to create them?
3
what is actually the main purpose behind design patterns?
4
all these questions and more will be answered in this first video of our design pattern series to which later we will add more videos detailing each pattern on its own.
5
As always and to better understand the concept at hand let's take a practical example and let's imagine a steak. You see I may have imagined a well done steak you may have imagined a medium done one someone else might have imagined a vegan steak, while ordering a steak at a restaurant, each one of us orders it differently we don't all necessarily have to order or eat our steak the same way and yet the cook that is preparing it, will take the same piece of meat or soy in addition to the way or policy of how we like our steak and prepare a delicious meal a different one for each one of us using the same piece of meat as a starting point To compare this to a computer program suppose we have a Chef class with a prepare() method This method can take a WellDoneInstruction object and in this prepare method the chef will know how to prepare a well-done steak but what about other ways of preparing a steak we will have to overload this method to take in a MediumDoneInstruction and a VeganInstruction Okay now our chef knows how to cook all the steaks we want Let's say this chef extended his knowledge and now knows of five additional ways to cook a steak should we add five more methods? Well let me suggest something else, why not replace all these methods with a single method that takes a steak cooking instruction and let all these classes inherit this one what do you think?
6
Isn't that a better design for our Chef class You see this way, our class is closed for modification and open for extension which means that not only we won't have to add any more methods nor even touch our Chef class in the future but in addition to this when a new instruction is needed all we have to do is extend the SteakCookingInstruction class we created with this new instruction and the prepare method will handle it automatically Now because of our design, this chef apparently skyrocketed and decided to open a new branch for the restaurant So every time a new customer enters the restaurant the chef goes ahead and informs them of the opening date and details for the new branch but do you think that is the best approach to deal with such a scenario?
7
Don't you think that instead of waiting for people to come in the chef should have instead messaged all his customers the details about the opening or even posted on social media and those interested would have showed up wouldn't his reach be far larger? In both previous scenarios the solutions I suggested hint at a specific pattern this pattern will not actually solve our problem and generate magically ready code for us but rather it will give us a description or template to follow a way of thinking that will help us solve these problems like a series of formalized best practices, steps that programmers have followed and used to solve common problems like the one we just encountered. Design Patterns best became known from the design patterns book by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides often referred to as the Gang of Four book published in the mid 90s.
8
Now, this book details 23 design patterns which were split into three groups: Creational Patterns, Structural Patterns, and Behavioral Patterns.
9
Creational patterns deal with the creation of objects Instead of you instantiating all objects very specifically and explicitly they give you more flexibility in how the objects are actually created Let's suppose that we have a class with 10 attributes but not every time we create an object based on this class we need to specify all 10 attributes sometimes you only need one, in other cases three or two, and sometimes eight or nine, in such cases we are left with two solutions and not quite the best out there: either to create a lot, like a lot, of overloaded constructors for our class or create one constructor that takes all arguments but then we will need to pass as null values the ones we don't require upon creation of our objects Well, design patterns will tell you wait, you have a third option follow the template provided by the Builder Pattern, a template widely used and tested by many developers out there Well if I were in your shoes I'd pick this last option.
10
Structural patterns deal with how classes are actually designed with how things like inheritance and composition and aggregation can be used to provide extra functionality Let's consider that in our application we are storing book objects and these books well there's too many of them, like in the hundred thousand books of a library, or the books in all of amazon online store, and for some reason we need to represent each book by an object You see in this case we will have a bunch of book objects that will share the same attributes and by bunch I mean in the thousands which will have the same author, the same amazon physical storage location, same places it can be delivered to, same provider, etc. you got the idea and maybe the only attribute that will defer is the title itself and the price in some cases So why create for each book an object and consume all this amount of memory while at the same time if we follow the template specified by the Flyweight Pattern we will be able to minimize memory usage by sharing as much data as possible between our similar objects You see that is what design patterns are trying to do they are trying to provide us with a schema, a step-by-step definition or template to help us overcome development or architectural problems that others have faced before us.
11
Finally, Behavioral patterns are specifically concerned with communication and assignment of responsibilities between objects as the program is running The two examples we gave at the beginning of our video can actually be solved using two different behavioral patterns one of them being the Strategy pattern Let's take a second example and suppose we realized that the state of an object in our application will be changed by a lot of other objects but we need to be able to undo the last change Well this can be done in many different ways and you are free to use any of them but there is a Memento design pattern that describes a simple proven approach. So to sum up, design patterns will speed up your development process by providing tested and proven development models At first you may not notice that you require the use of this pattern here or there or you may make use of it without even knowing but with time practice and hopefully with the help of our videos you will! So that's it for this video, I hope it was helpful, thank you guys for watching, take care and I will see you in the next one!
FOR YOU
推薦影片
本課的詞彙與口語要點
這節 C1 級別的口語課以影片“What are Design Patterns?”為素材。 影片中反覆出現的詞有:pattern, object, design, steak, chef。 這段影片共有 11 個句子、1284 個單詞可供跟讀。 講話部分時長為 7:17。 說話人語速自然,每分鐘約 176 個詞,接近日常對話。 85% 的單詞屬於英語最常用的 3,000 詞,其餘的詞建議在練習前先學一下。 全部 11 個句子中有 7 個是問句,適合練習疑問語調和簡短回答。
影片中的重點詞彙
影片中最難的 15 個單詞,附發音和釋義:
| 單詞 | 發音 | 釋義 |
|---|---|---|
| steak 名詞 | /steɪk/ | 牛排 |
| template 名詞 | /ˈtɛm.plɪt/ | 模板, 型板 |
| attribute 名詞 | /ˈæt.ɹɪˌbjut/ | 屬性 /屬性 |
| overload 動詞 | /ˌəʊvəˈləʊd/ | 超載 /超載 |
| schema 名詞 | /ˈskiːmə/ | 圖式 /圖式 |
| skyrocket 動詞 | /ˈskaɪˌɹɒk.ɪt/ | 飛漲 /飛漲, 平步青雲 /平步青雲 |
| inherit 動詞 | /ɪnˈhɛɹɪt/ | 繼承 /繼承, 繼承 |
| programmer 名詞 | /ˈpɹoʊɡɹæmɚ/ | 程式設計師 /程式設計師, 程式員 /程式員 |
| undo 動詞 | /ʌnˈduː/ | 復原 /復原, 重做 |
| geek 名詞 | /ɡiːk/ | 極客 /極客, 宅男 |
| functionality 名詞 | 功能, 功能性 | |
| null 名詞 | /nʌl/ | 空值 |
| minimize 動詞 | /ˈmɪn.ɪˌmaɪz/ | 最小化 |
| inheritance 名詞 | /ɪnˈhɛɹɪtəns/ | 繼承 /繼承 |
| consume 動詞 | /kənˈsum/ | 耗費 /耗費, 消耗 |
影片中出現的短語動詞
| 單詞 | 發音 | 釋義 |
|---|---|---|
| go ahead 動詞 | /ˌɡoʊ əˈhɛd/ | 請便 /請便 |
| show up 動詞 | 露面 | |
| speed up 動詞 | /spiːdˈʌp/ | 加速, 加快 |
影片中的語法
說話人最常用的結構,並附上影片中的原話:
| 結構 | 影片中的用法 |
|---|---|
| 條件句 if + 從句,will/would + 動詞 — 條件及其結果 | if I were in your shoes I'd pick |
| 被動語態 be + 過去分詞 — 強調發生了什麼,而不是誰做的 | will be answered · is closed · were split |
| 現在完成時 have/has + 過去分詞 — 過去發生但與現在仍有關聯的事 | have heard · have followed · have faced |
| 定語從句 who / which + 從句 — 補充說明人或事物 | extension which means · patterns which were · thousands which will |
需要注意的發音
說話人用了 8 次縮略和弱讀形式,例如 don't, I'd, isn't。請按聽到的簡短形式來說。
- “sh” 和 “zh” 音: aggregation /æɡɹəˈɡeɪʃən/, instantiate /ɪnˈstænʃieɪt/, modification /ˌmɑdɪfɪˈkeɪʃən/
- 長單詞——注意重音位置: behavioral /bɪˈheɪvjəɹəl/, aggregation /æɡɹəˈɡeɪʃən/, modification /ˌmɑdɪfɪˈkeɪʃən/, inheritance /ɪnˈhɛɹɪtəns/, architectural /ˌɑɹkɪˈtɛkt͡ʃəɹəl/
中文母語者容易讀錯的音:
- /v/ — 不要讀成 /w/,上齒輕觸下唇: behavioral /bɪˈheɪvjəɹəl/, overload /ˌəʊvəˈləʊd/, vegan /ˈviːɡən/
- 詞尾子音 — 要讀清楚,後面不要加母音: steak /steɪk/, template /ˈtɛm.plɪt/, attribute /ˈæt.ɹɪˌbjut/, overload /ˌəʊvəˈləʊd/, formalize /ˈfɔɹ.məlaɪːz/
- /r/ 和 /l/ 的區別: behavioral /bɪˈheɪvjəɹəl/, formalize /ˈfɔɹ.məlaɪːz/, architectural /ˌɑɹkɪˈtɛkt͡ʃəɹəl/
如何用這段影片練習
- 先完整聽一遍影片,不要開口,記下不認識的單詞。
- 先用 0.75 倍速逐句跟讀,熟練之後再回到正常速度。
- 錄下自己的聲音並與原聲對比,特別注意 steak, template, attribute 這類單詞。
什麼是跟讀法?
跟讀法 (Shadowing) 是一種有科學依據的語言學習技巧,最初開發用於專業口譯員的培訓,並由多語言者Alexander Arguelles博士普及。這個方法簡單而強大:您在聽英語母語原聲的同時立即大聲重複——就像是一個延遲1-2秒緊跟說話者的影子。與被動聽力或語法練習不同,跟讀法強迫您的大腦和口腔肌肉同時處理並模模擬實的講話模式。研究表明它能顯著提高發音準確性,語調,節奏,連讀,聽力理解和口語流利度——使其成為雅思口語備考和真實英語交流最有效的方法之一。




![How to Create a Women’s Bodice Block from Body Measurements [Pattern Making Tutorial]](https://img.youtube.com/vi/Bn594SV1nXA/mqdefault.jpg)







