通过使用装饰模式,实现执行调用的代码与提供缓存的代码相分离,将非常简单。
By using the Decorator pattern, it is simple to separate the code that performs invocations from the code that provides caching itself.
注意,数据库和Web服务操作位于单独的行中,因为它们分别由数据库引擎和Web服务实现执行。
Note that database and Web service operations are on separate lines because they are executed by the database engine and Web service implementation.
很多情况下,stub可加速初始开发,但无法实现执行整个代码路径和调用工作接口所能获得的功能。
In many cases, stubs speed up the initial development, but stubs do not provide the same level of functionality that you can get by exercising the full code path and calling a working interface.
So we want to write programs to do that.
为了实现这一目标我们要去写一个执行程序。
应用推荐