floater
Java Jedi
总版主
发贴: 3233
积分: 421
|
于 2004-12-02 00:01
invoker is the real client of commands, it invokes commands. The client box in the chart is the creator, similar to Spring object container.
接口里不应该有变量, to make maximal reuse. 变量 should be implementation specific, they have their setters. There are two logic flows here, one is the request flow, a request comes, a command response. Another flow is the creation of commands. So we have two dimensions.
2 cents.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler, Refactoring - Improving the Design of Existing Code
|