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.
您可以看到,在代码内部有针对每个操作系统的 if/else 链。
You can just picture the if/else chains inside the code for each OS.
让我们使用为纵横字谜助手创建的一些代码,创建从一个单词生成单词链的脚本(参见清单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).
应用推荐