您的位置:首页 > 其它

The Design Patterns Used in PetStore 2. Command

2004-12-26 17:40 429 查看
A facade's effectiveness is limited, since complex applications can cause the facade's API to grow too large. This is the case with the sample application. Rather than continuing to add methods to the session facade class, the petstore application implements a command pattern on top of the facade. A command pattern encapsulates each application function in a separate class. Each command instance represents a single request for an application service along with data necessary to perform the service.

Implementing a controller with a command pattern not only simplifies a session facade interface , it also keeps the controller implementation cleaner by encapsulating event- and request-handling tasks into smaller objects.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: