###
:2019,28(4):188-193
本文二维码信息
码上扫一扫!
Java EE数据初始化应用中的设计模式解决方案
(咸阳师范学院 计算机学院, 咸阳 712000)
Design Pattern Solution for Data Initialization of Java EE Application
(College of Computer, Xianyang Normal University, Xianyang 712000, China)
摘要
图/表
参考文献
相似文献
本文已被:浏览 199次   下载 118
投稿时间:2018-09-19    修订日期:2018-10-12
中文摘要: 针对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.
文章编号:     中图分类号:    文献标志码:
基金项目:陕西省教育厅专项科研计划项目(17JK0828);咸阳师范学院“青年骨干教师”培养项目(XSYGG201615);咸阳师范学院专项科研计划项目(XSYK17029)
引用文本:
欧阳宏基,葛萌.Java EE数据初始化应用中的设计模式解决方案.计算机系统应用,2019,28(4):188-193
OUYANG Hong-Ji,GE Meng.Design Pattern Solution for Data Initialization of Java EE Application.COMPUTER SYSTEMS APPLICATIONS,2019,28(4):188-193

用微信扫一扫

用微信扫一扫