基于面向对象设计模式的仓储系统设计与实现

2018-10-25 11:06:56周昱晨罗向阳张豪
计算机时代 2018年9期

周昱晨 罗向阳 张豪

摘 要: 针对杂志库存管理问题,基于面向对象思想,运用设计模式设计了一个库存管理系统。通过问题域部件设计,将系统划分为人员管理、物资管理和收益管理三部分,并设计了相关表单;通过任务管理部件设计,运用单例模式实现了并发审核,运用观察者模式保证了数据查询的准确和实时,运用状态模式实现了库存的调取,运用装饰器模式实现了收益统计,运用策略模式评估了来年印数与保留库存数;通过数据管理部件和人机交互部件设计,运用抽象工厂结合简单工厂的模式实现了多数据源访问支持;最后设计了用例进行测试。测试结果表明,该系统可以满足杂志库存管理的使用需求。

关键词: 面向对象设计; 问题域部件; 任务管理部件; 数据管理部件; 人机交互部件; 设计模式

中图分类号:TP311.5 文献标志码:A 文章编号:1006-8228(2018)09-33-04

Abstract: Aiming at the problem of inventory control of magazine, the object-oriented design pattern was used to design the inventory management system. In the design process of the problem domain components, the system was divided into 3 parts: personnel management, material management and earnings management, and business related forms were designed. In the design process of task management components, the singleton pattern was used to realize concurrent audit, the observer pattern was used to guarantee the accuracy and real-time of data query, the state pattern was used to realize inventory control, the decorator pattern was used to statistics of revenue and expenditure, the strategy pattern was used to evaluate the number of next year's printing and storage quantity. And in the design process of data management components and human interaction components, the abstract factory was used with the combination of the simple factory pattern to achieve the multiple data source access support. Finally, the use cases were designed and tested, and the results show that the system meets the needs of inventory management of magazine.

Key words: object-oriented design; problem domain components; task management components; data management components; human interaction components; design pattern

0 引言

仓储管理日益受到重视,当前研究主要着眼两方面:①优化库区、路径等;②根据业务设计优良的仓储管理系统[1]。

仓储管理系统应用广泛。杨春红[2]运用VB语言设计了快消品企业仓储系统,但其对模块的实现叙述简略;朱宇哲[3]等运用SSH框架设计了一个钢厂库存管理系统,通过MVC模型实现了底层数据、中间业务逻辑、前端视图的分离,但一方面作者运用的还是结构化设计思想,另一方面MVC不是一种设计模式,可看作多种模式的组合,虽然在系统层面实现了解耦,但在实现特定功能时解耦不如设计模式彻底。……

登录APP查看全文