Author Login Editor-in-Chief Peer Review Editor Work Office Work

Computer Engineering ›› 2007, Vol. 33 ›› Issue (08): 92-93. doi: 10.3969/j.issn.1000-3428.2007.08.031

• Software Technology and Database • Previous Articles     Next Articles

Optimizing Method of Filling Data to Template in Report Component

LUO Shengtao   

  1. (Software School, Fudan University, Shanghai 200433)
  • Received:1900-01-01 Revised:1900-01-01 Online:2007-04-20 Published:2007-04-20

报表组件中向模板填充数据的优化方法

罗胜涛   

  1. (复旦大学软件学院,上海 200433)

Abstract: Generally speaking, people fill data to the template according to the coordinate of the cell during the development of report forms component. But it increases the coupling between the code and the template, and it doesn’t benefit the maintainability and expansibility of the component. This paper solves the problem by user-defined tag, and then presents the method of filling data to the template according to the name of the tag not the coordinate of the cell. In this way, it is effective to decrease the coupling between the code and the template, at the same time, to improve the performance of the component with the pattern of service locator.

Key words: Report component, Template, Filling data, Service locator pattern, OpenOffice.org

摘要: 在报表组件的开发中,一般是按照单元格的坐标向模板填充数据,但这种方法增加了程序代码和模板之间的耦合度,不利于组件的维护和扩展。该文提出了一种优化方法,采用自定义标签解决了这个问题,按照标签名称来填充数据,而不是按坐标,从而有效地降低了程序代码和模板的耦合度,并采用服务定位模式提高了报表组件的性能。

关键词: 报表组件, 模板, 填充数据, 服务定位模式, OpenOffice.org