Java EE数据初始化应用中的设计模式解决方案
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

陕西省教育厅专项科研计划项目(17JK0828);咸阳师范学院“青年骨干教师”培养项目(XSYGG201615);咸阳师范学院专项科研计划项目(XSYK17029)


Design Pattern Solution for Data Initialization of Java EE Application
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 增强出版
  • |
  • 文章评论
    摘要:

    针对Java EE应用数据初始化时的先后顺序及依赖关系,提出一种基于设计模式的数据初始化方法.该方法首先将要初始化的数据看做一个复杂对象,通过建造者模式的产品角色来表示.利用抽象建造者角色定义数据初始化的先后顺序,使用Hibernate框架将各部分数据保存到数据库中;然后通过策略模式定义应用开发阶段和正式运行阶段的初始化算法;最后利用单例模式封装JDBC和Hibernate操作的通用步骤.以高等院校目标考核管理系统的数据初始化操作为背景,通过JXL读取存储在Excel文件中的初始化数据作为具体建造者角色的实现逻辑,详细阐述了该方法的具体实现过程.通过测试与实践表明该数据初始化方法能够满足系统应用要求,具有较高的复用度,能够提高数据初始化操作的扩展性和维护性.

    Abstract:

    According to the order and dependencies of data initialization for Java EE application, a data initialization method based on design pattern is proposed. First, the data to be initialized is regarded as a complex object, and it is represented by the product role of the builder mode, using the abstract builder role to define the order of data initialization, and using Hibernate framework to save every part of the data to the database. Then, it defines the initialization algorithm in the application development stage and the formal operation stage through the strategy pattern. Finally, it uses singleton pattern to encapsulate the general steps of JDBC and Hibernate operation. Taking the data initialization operation of target assessment management system in colleges and universities for example, through reading the initial data stored in the Excel file by JXL as the implementation logic of the concrete builder's role, the concrete realization process of the method is described in detail. The test and practice show that the data initialization method can meet the application requirements of the system, it has high reusability and can improve the expansibility and maintainability of data initialization operation.

    参考文献
    相似文献
    引证文献
引用本文

欧阳宏基,葛萌. Java EE数据初始化应用中的设计模式解决方案.计算机系统应用,2019,28(4):188-193

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2018-09-19
  • 最后修改日期:2018-10-12
  • 录用日期:
  • 在线发布日期: 2019-03-29
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京海淀区中关村南四街4号 中科院软件园区 7号楼305房间,邮政编码:100190
电话:010-62661041 传真: Email:csa (a) iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号