计算机工程 ›› 2009, Vol. 35 ›› Issue (19): 71-74.doi: 10.3969/j.issn.1000-3428.2009.19.023

• 软件技术与数据库 • 上一篇    下一篇

基于JSON和IoC的AJAX-RMI插件

黄 强1,王 薇2,张晓梅3,李 敏3   

  1. (1. 四川农业大学信息与工程技术学院,雅安 625000;2. 西南交通大学峨嵋校区计算机与通信工程系,峨嵋 614202; 3. 西南交通大学信息网络中心,成都 610031)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2009-10-05 发布日期:2009-10-05

AJAX-RMI Plug-in Based on JSON and IoC

HUANG Qiang1, WANG Wei2, ZHANG Xiao-mei3, LI Min3   

  1. (1. School of Information and Engineering Technology, Sichuan Agricultural University, Yaan 625000;
    2. Department of Computer and Communication Engineering, Southwest Jiaotong University Emei Campus, Emei 614202;
    3. Information and Network Center, Southwest Jiaotong University, Chengdu 610031)
  • Received:1900-01-01 Revised:1900-01-01 Online:2009-10-05 Published:2009-10-05

摘要: 异步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

中图分类号: