1、JavaScript-based message management mechanism Tengjiao, Wu Yue (University of Electronic Science and Technology Institute of Computer Science and Engineering, Chengdu 610054) (anderson soilhotmail corn) Abstract: According to the client Web application development for message management needs, desig
2、n a set of lightweight clients work on the Internet component-based message management system, implemented using JavaScript, you can add planted by the developer freedom, freedom to customize the message management the various properties, including the message type, message processing methods. Teste
3、d and applied in a number of projects, reflecting the message management mechanism of application value. Keywords: information management; JavaScript; Web applications CLC: TP311.52 Document code: A 基于 JavaScript的消息管理机制 何腾蛟,吴跃 (电子科技大学计算机科学与工程学院成都 610054) (anderson soilhotmail corn) 摘要:根据 Web应用中客户端开发
4、对消息管理的需求,设计了一套轻量级的工作于互联网客户端的构件化消息管理机制,采用 JavaScript实现,可以由开发人员自由加栽、自由定制消息管理器的各种属性,包括消息类型、消息处理方法等。通过测试并在多 个项目中的应用,反映出该消息管理机制的应用价值。 关键词 :消息管理; JavaScript; Web应用 中图分类号: TP311.52 文献标志码: A Introduction In most Web applications, the communication between the client and server message management remains a u
5、nilateral commitment by the server, the user and the web application developers who have brought a lot of restrictions. If the user needs to reproduce the history is limited to server request processing the request, if the request has been cleared by the server, or simply not kept, then the user can
6、 not reproduce; Web application developers to develop if it is based on WebService, while the use of the Web Service message mechanism can not be customized, or operability is poor, then the developers may not be fully realized product for message management needs. Therefore, this paper based on Jav
7、aSeript designed to run on the Web client message mechanism to achieve the messages can be customized, allowing developers to customize the message type and message processing details, allowing custom message management capacity, allows querying and processing of historical information; Meanwhile, t
8、he mechanism is component-based, can be loaded by the Web application without affecting any of its independence. 引言 在大多数的 Web应用中,客户端与服务器之间通信的消息管理仍然由服务器单方面的承担,对用户和 web应用的开发人员都带来许多限制。如用户重现历史请求的需求被局限于服务器对请求的处理,如果该请求已经被服务器清空,甚至根本没有保存,那么用户无法重现; Web应用的开发人员如果是基于 WebService进行开发,而所使用的Web Service的消息机制是不 可定制的,
9、或者说可操作性比较差,那么开发人员也许无法完全实现产品对消息管理的需求。因此,本文基于 JavaSeript设计了运行于 Web客户端的消息机制,实现了消息的可定制性,允许开发人员自定义消息类型及消息处理细节,允许自定义消息管理器容量,允许查询和处理历史消息;同时该机制也是组件化的,可以由 Web应用任意装载而不影响其独立性。 Message mechanism model Message mechanism is to manage the entire life cycle of the mechanism of the message, also called Message Manag
10、er is divided into four parts, Figure 1 depicts the Message Managers main components and interdepend- dencies. Basic management Primarily responsible for the message based information management, including the type management, message integrity verification, message content and message status set to
11、 deal with this four sub-modules. Dependencies between sub-modules shown in Figure 1. For example, the test is based on the type of manager to work, verifier to ensure work is completed setter structure of the received message is a complete message, so the test is dependent on the type of manager se
12、tter depends on the verifier. Generator Primarily responsible for generating the message. To prevent users send non-standard messages -. Norms for Message Manager, in 消息机制模型 消息机制是管理消息整个生命周期的机制,也可以称为消息管理器,主要分为 4个部分,图 1描述了消息管理器的主要组成部分和相互依赖关系。 基础管理 主要负责消息 的基础信息管理,包括类型管理、消息完整性的验证、消息内容的设置以及消息的状态处理这四个子模块。子模块之间的依赖关系如图1所示。例如,检验器是基于类型管理器工作的,检验器的工作完成后才能保证设置器所接受到的消息是结构完整的消息,所以检验器依赖于类型管理器,设置器依赖于检验器。 产生器 主要负责消息的产生。为避免使用者发送不规范消息 。规范”是针对消息管理器而言,在此设计消息管理器