让我们使用为纵横字谜助手创建的一些代码,创建从一个单词生成单词链的脚本(参见清单12)。
Let's create a script to generate word chains from a single word, using some of the code we created for the crossword helper (see Listing 12).
要确保对链中所有类的正确初始化,实现者必须手动编写超类方法调用的代码,如清单 11 所示。
To guarantee the correct initialization for all the classes in the chain, the implementer must manually code the superclass method invocation as shown in Listing 11.
Ranvier并不使用正则表达式把公共uri重写成私有uri,而是实现责任链(chain - of - responsibility)设计模式,把资源判断任务委托给相关代码。
Instead of using regular expressions to rewrite public URIs onto private ones, Ranvier implements a chain-of-responsibility design pattern to delegate resource determination to relevant code.
应用推荐