Skip to content

Commit

Permalink
Merge pull request #9 from macdao/master
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
gdut-yy authored Mar 22, 2020
2 parents 8147192 + 08e45e7 commit 5dee4c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/ch14.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
I once worked on a project where several teams were working in parallel on a major new system. One day, the team working on the customer-invoicing module was ready to implement an object they called Charge, when they discovered that another team had already built one. Diligently, they set out to reuse the existing object. They discovered it didn’t have an “expense code,” so they added one. It already had the “posted amount” attribute they needed. They had been planning to call it “amount due,” but—what’s in a name?—they changed it. Adding a few more methods and associations, they got something that looked like what they wanted, without disturbing what was there. They had to ignore many associations they didn’t need, but their application module ran.

> 我曾经参加过一个项目,在这个项目中几个团队同时开发一个重要的新系统。有一天,当负责“客户发票”模块的团队正准备实现一个他们称之为 Charge(收费)的对象时,他们发现另一个团队已经构建了这个对象,于是决定重复使用这个现有对象。他们发现它没有 expensecode(费用代码)属性,因此添加了一个。对象中有一个 posted amount(过账金额)属性是他们所需要的。他们本来计划把这个属性叫做 amount due(到期金额),但名称不同有什么关系呢?于是他们把名称改成了“posted amount”。又添加了几个方法和关联后,他们得到了所需的对象,而且没有扰乱任何事情。虽然他们必须忽略掉一些不需要的关联,但他们的模块运行很正常。
> 我曾经参加过一个项目,在这个项目中几个团队同时开发一个重要的新系统。有一天,当负责“客户发票”模块的团队正准备实现一个他们称之为 Charge(收费)的对象时,他们发现另一个团队已经构建了这个对象,于是决定重复使用这个现有对象。他们发现它没有 expense code(费用代码)属性,因此添加了一个。对象中有一个 posted amount(过账金额)属性是他们所需要的。他们本来计划把这个属性叫做 amount due(到期金额),但名称不同有什么关系呢?于是他们把名称改成了“posted amount”。又添加了几个方法和关联后,他们得到了所需的对象,而且没有扰乱任何事情。虽然他们必须忽略掉一些不需要的关联,但他们的模块运行很正常。
A few days later, mysterious problems surfaced in the bill-payment application module for which the Charge had originally been written. Strange Charges appeared that no one remembered entering and that didn’t make any sense. The program began to crash when some functions were used, particularly the month-to-date tax report. Investigation revealed that the crash resulted when a function was used that summed up the amount deductible for all the current month’s payments. The mystery records had no value in the “percent deductible” field, although the validation of the data-entry application required it and even put in a default value.

Expand Down
4 changes: 2 additions & 2 deletions docs/ch9.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Here are some warning signs that a constraint is distorting the design of its ho
When the constraints are obscuring the object’s basic responsibility, or when the constraint is prominent in the domain yet not prominent in the model, you can factor it out into an explicit object or even model it as a set of objects and relationships. (One in-depth, semiformal treatment of this subject can be found in The Object Constraint Language: Precise Modeling with UML [Warmer and Kleppe 1999].)

> 如果约束的存在掩盖了对象的基本职责,或者如果约束在领域中非常突出但在模型中却不明显,那么就可以将其提取到一个显式的对象中,甚至可以把它建模为一个对象和关系的集合。(TheObject Constraint Language:Precise Modeling with UML[Warmer and Kleppe 1999]一书中提供了关于这个问题的半正式的深入解决方案。)
> 如果约束的存在掩盖了对象的基本职责,或者如果约束在领域中非常突出但在模型中却不明显,那么就可以将其提取到一个显式的对象中,甚至可以把它建模为一个对象和关系的集合。(The Object Constraint Language:Precise Modeling with UML[Warmer and Kleppe 1999]一书中提供了关于这个问题的半正式的深入解决方案。)
Example: Review: Overbooking Policy

Expand Down Expand Up @@ -884,7 +884,7 @@ Example: Chemical Warehouse Packer
There is a warehouse in which various chemicals are stored in stacks of large containers, similar to boxcars. Some chemicals are inert and can be stored just about anywhere. Some are volatile and have to be stored in specially ventilated containers. Some are explosive and have to be stored in specially armored containers. There are also rules about the combinations allowed in a container.

> 以随意摆放。有些则是易挥发的,必须放于特制的通风容器中。还有一些是易爆品,必须保存于特制的防爆容器中。还有一些规则是关于如何在容器中混装化学品的。
> 假设有一个仓库,里面用类似于火车车厢的大型容器存放各种化学品。有些化学品是惰性的,可以随意摆放。有些则是易挥发的,必须放于特制的通风容器中。还有一些是易爆品,必须保存于特制的防爆容器中。还有一些规则是关于如何在容器中混装化学品的。
The goal is to write software that will find an efficient and safe way to put the chemicals in the containers.

Expand Down

0 comments on commit 5dee4c8

Please sign in to comment.