摘要: 异步JavaScript和XML(AJAX)客户端的 JavaScript与服务组件之间的通信存在较大阻抗,AJAX服务构件难以与现有MVC框架进行无侵略集成。基于结构化XML的数据交换体系占用系统资源和传输带宽较大,其结构不能有效适配客户和服务器系统。针对上述问题设计基于JSON数据交换、能与目前主流MVC框架进行无缝集成的AJAX远程方法调用插件MyAJAX,结合控制反转容器,提出服务组件的JavaScript动态存根生成和JSON序列化模型,实现JavaScript与容器内服务组件间的透明远程调用,给出MyAJAX的应用实例。
关键词:
异步JavaScript和XML技术,
JSON序列化,
动态存根生成,
同构对象
Abstract: Asynhronous JavaScript and XML(AJAX) has a big resistance to the communication between JavaScript at client side and the service module. AJAX service component is difficult to be integrated with current MVC framework non-invasively. Data exchange system based on structural XML occupies many system resources and transmission bandwidth, so its structure can not be matched effectively between client and server system. Aiming at these problems, a plug-in called MyAJAX based on JSON data exchange which can be seamlessly integrated with current mainstream MVC frameworks and can be interfaced by AJAX remote method is designed. With the Inverse of Control(IoC) container, the JavaScript dynamic stub generation and the JSON serializing model of service module are proposed to realize transparent remote call between JavaScript and the service module inside the container. Application instance of MyAJAX is given.
Key words:
Asynhronous JavaScript and XML(AJAX) technology,
JSON serialization,
dynamic stub generation,
isomorphic object
中图分类号:
黄 强;王 薇;张晓梅;李 敏. 基于JSON和IoC的AJAX-RMI插件[J]. 计算机工程, 2009, 35(19): 71-74.
HUANG Qiang; WANG Wei; ZHANG Xiao-mei; LI Min. AJAX-RMI Plug-in Based on JSON and IoC[J]. Computer Engineering, 2009, 35(19): 71-74.