Page 213 - Tuesday, 26 September 2017
Benefits of MVC
An application can accumulate features until it is too complicated to understand. Separating code into classes helps you design and understand the application as a whole; you can think in terms of classes instead of individual variables and methods.
Similarly, separating classes into model, view, and controller layers helps you design and understand an application; you can think in terms of layers instead of individual classes.
accumulate 积累
in terms of 依据,按照,在···方面
MVC also makes classes easier to reuse. A class with restricted responsibilities is more reusable than one with its fingers in every pie.
- with its fingers in every pie
- https://english.stackexchange.com/questions/293826/meaning-of-have-ones-fingers-in-every-pie
- https://www.collinsdictionary.com/zh/dictionary/english/a-finger-in-every-pie
- 上面整段话可以理解为:使用 MVC 模式还可以让类的复用更加容易。相比功能多而全的类,功能单一的专用类更加有利于代码复用。
Notice that you use the escape sequence ' in the last value to get an apostrophe in your string. You can use all the usual escape sequences in your string resources, such as \n for a new line.
apostrophe 文中指单引号
escape sequence 文中指转义字符
Take a moment to put this code into a private method instead, as shown in Listing 2.9.
- Take a moment 花点时间
Now that you have the questions behaving appropriately, it is time to turn to the answers. At the moment, GeoQuiz thinks that the answer to every question is “true.” Let’s rectify that. Here again, you will implement a private method to encapsulate code rather than writing similar code in two places.
appropriately 恰当地
rectify 改正
Here again 同样