为了使代码更容易扩展,要使用清单14所示的分派表。
To make the code more easily extensible, use a dispatch table, as shown in Listing 14.
尤其是,通过使用分派表,可以按照非常清晰且可维护的方式处理许多不同结构的元素类型。
In particular, use of dispatch tables makes it possible to deal with many differently structured element types in a very clear and maintainable way.
对于服务程序来说,main的代码令人惊讶地简短,因为它只创建分派表并启动控制分派机。
In case of services, the code for main will be surprisingly short, since it just creates the dispatch table and starts the control dispatcher.
应用推荐