+ -
当前位置:首页 → 问答吧 → 第二章《价值对象模式》校验工作完毕!

第二章《价值对象模式》校验工作完毕!

时间:2006-04-16

来源:互联网

部分和翻译者意思有出入的语句:
---------------------------------------------------------------
1.第43页
译者:提供一个没有设定的允许更改属性的函数。
原文:3. Provide no “setter” functions, which otherwise allow attributes to be altered.
校验:类中没有“设定”作用的函数,另外属性可以改变 。
---------------------------------------------------------------
2. 第43页
译者:让我们浏览一下在语言环境中的一个最大的例子----价值对象模式(The Value Object Pattern),
原文:Let’s explore the Value Object pattern in the context of a larger example.
校验:让我们探讨一下价值对象模式在较复杂的例子中应用的情况。
---------------------------------------------------------------
3. 第44页
译者:让我们再加上一个Player::getBalance()方法使访问当前Player和Monopoly类对象运行中的Player对象的保存当前可用的现款生效。
原文:In addition to that method,
let’s add the method Player::getBalance() to access a player’s cash reserve current to validate that
the Player and Monopoly objects are working,
校验:让我们再加上一个Player::getBalance()方法来访问一个player的现款,从而确保Player和Monopoly两个对象的正常运行。
---------------------------------------------------------------
4. 第46页
译者:如果采用Dollar::debit(),Player::pay()方法就变为简单了:
原文:Given Dollar::debit(), Player::pay() remains simple:
校验:给出的Dollar::debit(),Player::pay()方法还是很简单的。
---------------------------------------------------------------
5. 第47页
译者:在对一个商务平台建模的时候,如果在上下文提到“商务逻辑”看起来是不完善的 。商务在这里并不是所涉及到的从事商业的公司,而是一些领域中特殊应用需求的概念。就像“在这儿你的商务什么?”一样,考虑商务的解释犹如“一个直接的任务或目标”。当然,垄断领域的特定问题与“商务逻辑”可能的涵义正好相同。
原文:Mentioning “business logic” in the context of modeling a board game may seem odd. The business here
does not refer to companies engaged in the act of commerce, but rather to the concept of applicationspecific
requirements in the domain the application is addressing. Think of the definition of business as
“an immediate task or objective,” as in “What is your business here?”,
Of course, given the problem domain for Monopoly, perhaps the connotations of “business logic” apply
just the same.
校验:提及的“商业逻辑”用在一个游戏平台的例子上似乎无法理解。这里的商业意思不是在商务中忙碌的公司,而是有明确要求的应用领域。想一下这里商业的定义应该是“一个直接的任务或目标”,而不是你所想象的商业。
当然,这里给出的Monopoly可能和“商业逻辑”意思差不多。
---------------------------------------------------------------
6. 第47页
译者:PHP4的的copy-by-value复制对象的语法和价值对象设计模式是一样的。
原文:PHP 4’s copy-by-value object semantics work naturally with the Value Object pattern.
校验:php4所创建copy-by-value对象的语义天生就是用来实行价值对象模式的。
---------------------------------------------------------------
7. 第49页
译者:声明assertIsA()函数让你测试一个已命名类的实例(或继承)的一个特定的变量。你也可以使用这种声明去改变象string,number,或array这样的PHP的基类型。
原文:The assertIsA() assertion lets you test if a particular variable is an instance (or descendant) of a named
class. You can also use this assertion to validate against PHP base types like string, number, or array as
well.
校验:assertIsA()的作用是让你测试:一个特定的变量是否是一个实例化的类。当然你也可以用它来证明一些php类型:字符串、数字、数组等。
---------------------------------------------------------------
8. 第50页
译者:现在,应当用Dollar对象的移植的返回适当数量的数组,来代替已存在的正确大小的数组,
原文;Now, instead of just being the correct size array, the returned array must be populated with Dollar objects of the correct amount.
校验:现在,应当返回存有正确数据的Dollar对象,而不是简单的返回正确大小数组。
---------------------------------------------------------------
9. 第51页
译者:你可以在测试实例时使用它,但你必须确保这两个参数是不同的。
原文:You can use it in test cases whenever you need to make sure two values are different.
校验:当你要确保两个变量不同时,你可以用它来作测试。

[ 本帖最后由 h058 于 2006-4-16 08:13 编辑 ]

作者: h058   发布时间: 2006-04-15

GOOD!

楼主很专业~^_^

作者: feifengxlq   发布时间: 2006-04-16

引用:
原帖由 feifengxlq 于 2006-4-16 01:33 发表
GOOD!

楼主很专业~^_^
谢谢,请多多指教,

作者: h058   发布时间: 2006-04-16

我也非常感谢楼主的校验,谢谢!

作者: forest   发布时间: 2006-04-17

小弟下载学习拉!!
多谢多谢

作者: henanren   发布时间: 2006-05-05

热门下载

更多