+ -
当前位置:首页 → 问答吧 → 10->The Specification Pattern(feifengxlq预定)

10->The Specification Pattern(feifengxlq预定)

时间:2006-03-27

来源:互联网

10
The Specification
Pattern
AS AN APPLICATION TAKES SHAPE, bits of business logic sprout up everywhere, seemingly of
their own volition. One object must limit items based on price; another object must choose
the right rate for sales tax; and yet another must determine if any special conditions apply to
the current order. Some business rules are simple, requiring little more than one or two boolean comparisons,
while other rules can require protracted computations, needing database queries and user
input to guide them.
Writing code transforms the abstract (a business rule) into something concrete. But abstractions
(such as shopping styles, tax rates, and shipping fee calculations) have a way of evolving and multiplying
and such changes can easily overwhelm a hapless developer. To stay safe―as you’ve seen so far in
this book―it’s ideal to encapsulate and isolate what readily changes whenever possible. And indeed,
that’s also a wise strategy for business rules, too.

作者: PHPChina   发布时间: 2006-03-26

...

作者: Bantu   发布时间: 2006-03-28

下了看了才知道有那么多啊...翻不了...

作者: luocatboy   发布时间: 2006-03-29

我来翻译~

作者: feifengxlq   发布时间: 2006-03-29

大概翻译日程:
目前完成了该章节的1/3
计划这周翻译完毕,下周开始校验。

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

飞凤和bantu到时协助校验!:D

作者: PHPChina   发布时间: 2006-04-06

没问题^_^

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

引用:
原帖由 phpchina 于 2006-4-6 12:02 发表
飞凤和bantu到时协助校验!:D
好的。

作者: Bantu   发布时间: 2006-04-07

^_^~~我的翻译完毕啦!

现在进行校验阶段!

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

初试校验通过。现在贴出本章得专业名词
business logic  商业逻辑
Hard Coded Specification. 硬编码规范
Policy Factory方案工厂 策略工厂
Specification pattern 规范模式
WACT Web Application Component Toolkit WEB应用程序组件工具箱
HashMap哈希图
PolicyFactor方法器
Constructor 构造器

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

贴上来代码显示得不好,所以就提供word下载了。

需要权限是50以上

[ 本帖最后由 feifengxlq 于 2006-4-9 13:59 编辑 ]

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

好的!接收!

作者: PHPChina   发布时间: 2006-04-09

我觉得贴Wiki里比较好。
:)

作者: Bantu   发布时间: 2006-04-09

贴在wiki里面?
我去试试先~

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

热门下载

更多